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

@@ -9,6 +9,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)) %>%
@@ -79,7 +80,7 @@ p = ggplot(data=D, aes(x=blocksPerCpuFactor, y=tnorm, color=bad)) +
# Labels
labs(x="Blocks/CPU", y="Normalized time",
title=sprintf("Nbody normalized time. Particles=%d", particles),
subtitle=input_file) +
subtitle=output) +
# Center the title
@@ -117,7 +118,7 @@ p1 = ggplot(D, aes(x=blocksizeFactor, y=time)) +
labs(x="Blocksize", 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.8)) +
@@ -138,7 +139,7 @@ p2 = ggplot(D, aes(x=blocksPerCpuFactor, y=time)) +
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)) +

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)) %>%
@@ -50,7 +51,7 @@ p = ggplot(data=D, aes(x=blocksPerCpuFactor, y=tnorm)) +
# Labels
labs(x="Blocks/CPU", 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)) +
@@ -95,7 +96,7 @@ p = ggplot(D, aes(x=blocksPerCpuFactor, y=time, color=freeCpu)) +
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)) +

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)) +

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)) %>%
@@ -53,7 +54,7 @@ p = ggplot(data=D, aes(x=blocksPerCpuFactor, y=tnorm, color=bad)) +
# Labels
labs(x="Blocks/CPU", y="Normalized time",
title=sprintf("Nbody normalized time. Particles=%d", particles),
subtitle=input_file) +
subtitle=output) +
# Center the title
@@ -94,7 +95,7 @@ p = ggplot(D, aes(x=blocksPerCpuFactor, y=time)) +
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)) +