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)) %>%
|
||||
@@ -49,7 +50,7 @@ heatmap_plot = function(df, colname, title) {
|
||||
guides(fill = guide_colorbar(barwidth=12, title.vjust=0.8)) +
|
||||
labs(x="cbs", y="rbs",
|
||||
title=sprintf("Heat granularity: %s", title),
|
||||
subtitle=input_file) +
|
||||
subtitle=output) +
|
||||
theme(legend.position="bottom")
|
||||
|
||||
k=1
|
||||
|
||||
@@ -9,6 +9,7 @@ args = commandArgs(trailingOnly=TRUE)
|
||||
|
||||
# Set the input dataset if given in argv[1], or use "input" as default
|
||||
if (length(args)>0) { input_file = args[1] } else { input_file = "input" }
|
||||
if (length(args)>1) { output = args[2] } else { output = "?" }
|
||||
|
||||
df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>%
|
||||
|
||||
@@ -47,7 +48,7 @@ p = ggplot(df, aes(x=cbs, y=normalized.time)) +
|
||||
theme_bw() +
|
||||
labs(y="Normalized time",
|
||||
title="Heat granularity: normalized time",
|
||||
subtitle=input_file) +
|
||||
subtitle=output) +
|
||||
theme(plot.subtitle=element_text(size=8))
|
||||
|
||||
ggsave("normalized.time.png", plot=p, width=w, height=h, dpi=dpi)
|
||||
@@ -60,7 +61,7 @@ p = ggplot(df, aes(x=cbs, y=time)) +
|
||||
geom_line(aes(y=median.time, group=0)) +
|
||||
theme_bw() +
|
||||
labs(y="Time (s)", title="Heat granularity: time",
|
||||
subtitle=input_file) +
|
||||
subtitle=output) +
|
||||
theme(plot.subtitle=element_text(size=8))
|
||||
|
||||
ggsave("time.png", plot=p, width=w, height=h, dpi=dpi)
|
||||
|
||||
@@ -10,6 +10,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)) %>%
|
||||
@@ -62,7 +63,7 @@ heatmap_plot = function(df, colname, title) {
|
||||
guides(fill = guide_colorbar(barwidth=12, title.vjust=0.8)) +
|
||||
labs(x="cbs", y="rbs",
|
||||
title=sprintf("Heat granularity: %s", title),
|
||||
subtitle=input_file) +
|
||||
subtitle=output) +
|
||||
theme(legend.position="bottom")
|
||||
|
||||
k=1
|
||||
@@ -103,7 +104,7 @@ p = ggplot(df_square, aes(x=cbs, y=acc.time)) +
|
||||
labels = c("Total time"), guide = "legend") +
|
||||
labs(x="Blocksize (side)", y="Time (s)",
|
||||
fill="Estimated", color="Direct measurement",
|
||||
title="Heat granularity: time distribution", subtitle=input_file)
|
||||
title="Heat granularity: time distribution", subtitle=output)
|
||||
|
||||
ggsave("area.time.png", plot=p, width=6, height=6, dpi=300)
|
||||
ggsave("area.time.pdf", plot=p, width=6, height=6, dpi=300)
|
||||
@@ -115,7 +116,7 @@ p = ggplot(df_square, aes(x=cbs, y=acc.time)) +
|
||||
theme(legend.position=c(0.5, 0.7)) +
|
||||
labs(x="Blocksize (side)", y="Time (s)",
|
||||
fill="Estimated", color="Direct measurement",
|
||||
title="Heat granularity: time distribution", subtitle=input_file)
|
||||
title="Heat granularity: time distribution", subtitle=output)
|
||||
|
||||
ggsave("col.time.png", plot=p, width=6, height=6, dpi=300)
|
||||
ggsave("col.time.pdf", plot=p, width=6, height=6, dpi=300)
|
||||
|
||||
Reference in New Issue
Block a user