fig: use the $out path in the subtitle

The input dataset is not enough to determine which script produced a
given plot.
This commit is contained in:
2021-04-21 13:40:25 +02:00
parent 5a49611bf6
commit 92cd88e365
28 changed files with 88 additions and 61 deletions

View File

@@ -8,6 +8,7 @@ args=commandArgs(trailingOnly=TRUE)
# Read the timetable from args[1]
input_file = "input.json"
if (length(args)>0) { input_file = args[1] }
if (length(args)>1) { output = args[2] } else { output = "?" }
# Load the dataset in NDJSON format
dataset = jsonlite::stream_in(file(input_file)) %>%
@@ -52,7 +53,7 @@ p = ggplot(data=D, aes(x=nblocks, y=tnorm)) +
# Labels
labs(x="Num blocks", y="Normalized time",
title=sprintf("Nbody normalized time. Particles=%d", particles),
subtitle=input_file) +
subtitle=output) +
# Center the title
#theme(plot.title = element_text(hjust = 0.5)) +
@@ -96,7 +97,7 @@ p = ggplot(D, aes(x=blocksPerCpu, y=time, color=jemalloc)) +
labs(x="Blocks/CPU", y="Time (s)",
title=sprintf("Nbody granularity. Particles=%d", particles),
subtitle=input_file) +
subtitle=output) +
theme_bw() +
theme(plot.subtitle=element_text(size=8)) +
theme(legend.position = c(0.5, 0.88)) +