diff --git a/results/intermittent/normalized_time_box.pdf b/results/intermittent/normalized_time_box.pdf index 3e5fe39..9520620 100644 Binary files a/results/intermittent/normalized_time_box.pdf and b/results/intermittent/normalized_time_box.pdf differ diff --git a/results/plots/execution_time_10uF_normalized.pdf b/results/plots/execution_time_10uF_normalized.pdf index 10ac1b0..8083ea8 100644 Binary files a/results/plots/execution_time_10uF_normalized.pdf and b/results/plots/execution_time_10uF_normalized.pdf differ diff --git a/results/plots/execution_time_50uF_normalized.pdf b/results/plots/execution_time_50uF_normalized.pdf index 6733db7..118d371 100644 Binary files a/results/plots/execution_time_50uF_normalized.pdf and b/results/plots/execution_time_50uF_normalized.pdf differ diff --git a/results/plots/execution_time_5uF_normalized.pdf b/results/plots/execution_time_5uF_normalized.pdf index 32e6ec3..154e1d5 100644 Binary files a/results/plots/execution_time_5uF_normalized.pdf and b/results/plots/execution_time_5uF_normalized.pdf differ diff --git a/results/plots/runtime_region_boundary_calls_10uF_normalized.pdf b/results/plots/runtime_region_boundary_calls_10uF_normalized.pdf index 07a5fa2..8d99519 100644 Binary files a/results/plots/runtime_region_boundary_calls_10uF_normalized.pdf and b/results/plots/runtime_region_boundary_calls_10uF_normalized.pdf differ diff --git a/results/plots/runtime_region_boundary_calls_50uF_normalized.pdf b/results/plots/runtime_region_boundary_calls_50uF_normalized.pdf index acac40f..a0149e2 100644 Binary files a/results/plots/runtime_region_boundary_calls_50uF_normalized.pdf and b/results/plots/runtime_region_boundary_calls_50uF_normalized.pdf differ diff --git a/results/plots/runtime_region_boundary_calls_5uF_normalized.pdf b/results/plots/runtime_region_boundary_calls_5uF_normalized.pdf index 89540e2..4f3be27 100644 Binary files a/results/plots/runtime_region_boundary_calls_5uF_normalized.pdf and b/results/plots/runtime_region_boundary_calls_5uF_normalized.pdf differ diff --git a/scripts/plot_common.R b/scripts/plot_common.R index ab16981..4fb1d70 100644 --- a/scripts/plot_common.R +++ b/scripts/plot_common.R @@ -126,6 +126,13 @@ PATTERN_LEGEND_SPACING <- 0.055 PATTERN_LEGEND_ALPHA <- 1.0 PATTERN_LEGEND_SIZE <- 0.42 +# Compact paper figure dimensions. Preserve readable text and reclaim vertical +# space from the legend before shrinking the data panel. +PLOT_HEIGHT_IN <- 2.6 +LEGEND_KEY_HEIGHT_CM <- 0.55 +AXIS_TITLE_SIZE <- 13 +AXIS_SUBTITLE_SIZE <- 9.5 + # -- Axis title --------------------------------------------------------------- # Y-axis title with a smaller second line. Plotmath's atop() pads the two @@ -133,13 +140,16 @@ PATTERN_LEGEND_SIZE <- 0.42 # swapped into the rendered gtable. stack_ylab <- function(p, main, sub) { main_g <- textGrob(main, rot = 90, - gp = gpar(fontsize = 15.5, fontfamily = "Helvetica")) + gp = gpar(fontsize = AXIS_TITLE_SIZE, + fontfamily = "Helvetica")) sub_g <- textGrob(sub, rot = 90, - gp = gpar(fontsize = 11, fontfamily = "Helvetica")) + gp = gpar(fontsize = AXIS_SUBTITLE_SIZE, + fontfamily = "Helvetica")) # Column widths are line heights rather than grobWidth(), which ignores # descenders. title <- gtable( - widths = unit(c(15.5 * 1.2, 11 * 1.2, 7), "pt"), + widths = unit(c(AXIS_TITLE_SIZE * 1.2, + AXIS_SUBTITLE_SIZE * 1.2, 7), "pt"), heights = unit(1, "null") ) title <- gtable_add_grob(title, list(main_g, sub_g), t = 1, l = c(1, 2)) diff --git a/scripts/plot_intermittent.R b/scripts/plot_intermittent.R index 8195d7b..1590c42 100644 --- a/scripts/plot_intermittent.R +++ b/scripts/plot_intermittent.R @@ -44,13 +44,16 @@ theme_benchmark <- function() { theme_minimal(base_size = 15, base_family = "Helvetica") + theme( axis.title.x = element_blank(), - axis.title.y = element_text(size = 15.5, margin = margin(r = 7)), + axis.title.y = element_text(size = AXIS_TITLE_SIZE, + margin = margin(r = 7)), axis.text.x = element_text(size = 11), axis.text.y = element_text(size = 12.5), legend.position = "top", legend.title = element_blank(), legend.text = element_text(size = 13), - legend.key.size = unit(0.68, "cm"), + legend.key.height = unit(LEGEND_KEY_HEIGHT_CM, "cm"), + legend.key.width = unit(0.68, "cm"), + legend.box.spacing = unit(0.01, "cm"), legend.margin = margin(0, 0, 0, 0), panel.grid.major.x = element_blank(), panel.grid.minor = element_blank(), @@ -132,5 +135,5 @@ p_box <- ggplot(box_data, aes(benchmark, normalized, fill = algo)) + y_scale + theme_benchmark() ggsave(file.path(output_dir, "normalized_time_box.pdf"), - stack_ylab(p_box, "Relative Execution Time", paste0("(to ", REF_LABEL, ")")), - width = 12.5, height = 3.95) + stack_ylab(p_box, "Relative Time", paste0("(to ", REF_LABEL, ")")), + width = 12.5, height = PLOT_HEIGHT_IN) diff --git a/scripts/plot_results.R b/scripts/plot_results.R index 6ab8902..d437461 100644 --- a/scripts/plot_results.R +++ b/scripts/plot_results.R @@ -51,36 +51,36 @@ METRICS <- list( region_boundaries = list( source = "debug", column = "region_boundaries", include_baselines = FALSE, - ylabel = "# Region Boundaries (static)", - relative_ylabel = "Relative Region Boundaries", + ylabel = "# Static Boundaries", + relative_ylabel = "Relative Boundaries", title = "Region Boundaries" ), runtime_region_boundary_calls = list( source = "debug", column = "runtime_region_boundary_calls", include_baselines = FALSE, - ylabel = "# Runtime Region Boundary Calls", - relative_ylabel = "Relative Region Boundary Hits", + ylabel = "# Boundary Calls", + relative_ylabel = "Relative Hits", title = "Region Boundary Calls at Run-time" ), execution_time = list( source = "no-debug", column = "execution_time_us", include_baselines = TRUE, ylabel = expression("Execution Time (" * mu * "s)"), - relative_ylabel = "Relative Execution Time", + relative_ylabel = "Relative Time", title = "Execution Time" ), profiling_time = list( source = "no-debug", column = "profiling_time_ms", include_baselines = FALSE, ylabel = "Profiling Time (ms)", - relative_ylabel = "Relative Profiling Time", + relative_ylabel = "Relative Profile Time", title = "Profiling Time" ), compilation_time = list( source = "no-debug", column = "compilation_time_ms", include_baselines = TRUE, ylabel = "Compilation Time (ms)", - relative_ylabel = "Relative Compilation Time", + relative_ylabel = "Compilation Ratio", title = "Compilation Time" ) ) @@ -97,14 +97,17 @@ theme_benchmark <- function() { plot.title = element_blank(), plot.caption = element_text(color = "grey35", size = 10.5, hjust = 0, margin = margin(t = 4)), - axis.title.x = element_text(size = 15.5, margin = margin(t = 7)), - axis.title.y = element_text(size = 15.5, margin = margin(r = 7)), + axis.title.x = element_text(size = AXIS_TITLE_SIZE, + margin = margin(t = 7)), + axis.title.y = element_text(size = AXIS_TITLE_SIZE, + margin = margin(r = 7)), axis.text.x = element_text(size = 14, angle = 15, hjust = 1, vjust = 1), axis.text.y = element_text(size = 12.5), legend.position = "top", legend.title = element_blank(), legend.text = element_text(size = 13), - legend.key.size = unit(0.68, "cm"), + legend.key.height = unit(LEGEND_KEY_HEIGHT_CM, "cm"), + legend.key.width = unit(0.68, "cm"), legend.box.spacing = unit(0.01, "cm"), legend.margin = margin(0, 0, 0, 0), panel.grid.major.x = element_blank(), @@ -249,9 +252,10 @@ OUTLIER_HEADROOM <- 1.15 # extent are fractions of the panel height (axis space), so they look the # same on linear, pseudo-log, and log axes. LABEL_SIZE <- 3.6 -LABEL_GAP <- 0.015 -LABEL_EXTENT_BASE <- 0.01 -LABEL_EXTENT_PER_CHAR <- 0.028 +LABEL_HEIGHT_SCALE <- 3.95 / PLOT_HEIGHT_IN +LABEL_GAP <- 0.015 * LABEL_HEIGHT_SCALE +LABEL_EXTENT_BASE <- 0.01 * LABEL_HEIGHT_SCALE +LABEL_EXTENT_PER_CHAR <- 0.028 * LABEL_HEIGHT_SCALE format_metric_value <- function(value, normalize) { if (normalize) { return(if (value >= 100) sprintf("%.0f", value) @@ -781,7 +785,8 @@ main <- function() { w <- max(6.4, n_bm * 0.9 + 1.4) save_plot <- function() { - ggsave(filepath, p, width = w, height = 3.95, device = PDF_DEVICE) + ggsave(filepath, p, width = w, height = PLOT_HEIGHT_IN, + device = PDF_DEVICE) } if (HAS_GGPATTERN && log_scale && metric_key %in% LOG_SCALE_METRICS) { # ggpattern bars still originate at y = 0 internally, so log-scale