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:
@@ -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)) +
|
||||
|
||||
Reference in New Issue
Block a user