forked from rarias/bscpkgs
nbody: update and simplify figures
This commit is contained in:
@@ -10,10 +10,11 @@ if (length(args)>0) { input_file = args[1] } else { input_file = "input" }
|
||||
|
||||
df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>%
|
||||
jsonlite::flatten() %>%
|
||||
select(config.blocksize, config.gitBranch, unit, time) %>%
|
||||
rename(blocksize=config.blocksize, branch=config.gitBranch) %>%
|
||||
select(config.blocksize, config.gitBranch, config.particles, unit, time) %>%
|
||||
rename(blocksize=config.blocksize, particles=config.particles, branch=config.gitBranch) %>%
|
||||
|
||||
mutate(blocksize = as.factor(blocksize)) %>%
|
||||
mutate(particles = as.factor(particles)) %>%
|
||||
mutate(branch = as.factor(branch)) %>%
|
||||
mutate(unit = as.factor(unit)) %>%
|
||||
|
||||
@@ -27,22 +28,7 @@ df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>%
|
||||
|
||||
dpi = 300
|
||||
h = 5
|
||||
w = 8
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
p = ggplot(df, aes(x=blocksize, y=median.time, color=branch)) +
|
||||
geom_point() +
|
||||
geom_line(aes(group=branch)) +
|
||||
theme_bw() +
|
||||
labs(x="Blocksize", y="Median time (s)", title="NBody Granularity: Median Time",
|
||||
subtitle=input_file) +
|
||||
theme(plot.subtitle=element_text(size=5)) +
|
||||
theme(legend.position="bottom") +
|
||||
theme(legend.text = element_text(size=7))
|
||||
|
||||
ggsave("median.time.png", plot=p, width=w, height=h, dpi=dpi)
|
||||
ggsave("median.time.pdf", plot=p, width=w, height=h, dpi=dpi)
|
||||
w = 5
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
@@ -53,7 +39,7 @@ p = ggplot(df, aes(x=blocksize, y=normalized.time, color=branch)) +
|
||||
theme_bw() +
|
||||
labs(x="Blocksize", y="Normalized Time", title="NBody Granularity: Normalized Time",
|
||||
subtitle=input_file) +
|
||||
theme(plot.subtitle=element_text(size=5)) +
|
||||
theme(plot.subtitle=element_text(size=8)) +
|
||||
theme(legend.position="bottom") +
|
||||
theme(legend.text = element_text(size=7))
|
||||
|
||||
@@ -62,31 +48,14 @@ ggsave("normalized.time.pdf", plot=p, width=w, height=h, dpi=dpi)
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
p = ggplot(df, aes(x=blocksize, y=time, color=branch)) +
|
||||
geom_point(shape=21, size=3) +
|
||||
p = ggplot(df, aes(x=blocksize, y=time)) +
|
||||
geom_boxplot() +
|
||||
theme_bw() +
|
||||
labs(x="Blocksize", y="Time (s)", title="NBody Granularity: Time",
|
||||
subtitle=input_file) +
|
||||
theme(plot.subtitle=element_text(size=5)) +
|
||||
theme(plot.subtitle=element_text(size=8)) +
|
||||
theme(legend.position="bottom") +
|
||||
theme(legend.text = element_text(size=7))
|
||||
|
||||
ggsave("time.png", plot=p, width=w, height=h, dpi=dpi)
|
||||
ggsave("time.pdf", plot=p, width=w, height=h, dpi=dpi)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
p = ggplot(df, aes(x=blocksize, y=branch, fill=median.time)) +
|
||||
geom_raster() +
|
||||
scale_fill_viridis(option="plasma") +
|
||||
coord_fixed() +
|
||||
theme_bw() +
|
||||
labs(x="Blocksize", y="Branch", title="NBody Granularity: Time",
|
||||
subtitle=input_file) +
|
||||
theme(plot.subtitle=element_text(size=5)) +
|
||||
theme(legend.position="bottom") +
|
||||
theme(legend.text = element_text(size=7))
|
||||
|
||||
ggsave("time.heatmap.png", plot=p, width=w, height=h, dpi=dpi)
|
||||
ggsave("time.heatmap.pdf", plot=p, width=w, height=h, dpi=dpi)
|
||||
|
||||
Reference in New Issue
Block a user