forked from rarias/bscpkgs
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:
@@ -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)) +
|
||||
|
||||
|
||||
Reference in New Issue
Block a user