Chart consistency + visual cleanup
This commit is contained in:
@@ -3,8 +3,8 @@ library(dplyr)
|
||||
library(readr)
|
||||
library(stringr)
|
||||
|
||||
# Usage: Rscript ratio_comparison_merged.r exp_abspath1 exp_abspath2 ... [resultsdata_file]
|
||||
# Sums all benchmarks
|
||||
# Usage: Rscript ratio_comparison_merged_trap.r exp_abspath1 exp_abspath2 ... [resultsdata_file]
|
||||
# Sums all benchmarks, merges GROUP1_MARKER into TRAP
|
||||
|
||||
args <- commandArgs(trailingOnly = TRUE)
|
||||
if (length(args) < 2) {
|
||||
@@ -59,7 +59,9 @@ if (nrow(all_data) == 0) {
|
||||
stop("No data loaded")
|
||||
}
|
||||
|
||||
# Add all benchs together (per marker type)
|
||||
all_data <- all_data |>
|
||||
mutate(resulttype = ifelse(resulttype == "GROUP1_MARKER", "TRAP", resulttype))
|
||||
|
||||
merged_data <- all_data |>
|
||||
group_by(base_name, variant, resulttype) |>
|
||||
summarise(faults = sum(faults), .groups = "drop")
|
||||
@@ -88,15 +90,21 @@ plot <- ggplot(
|
||||
geom_line() +
|
||||
facet_wrap(~base_name) +
|
||||
scale_y_log10(name = "Ratio (to C)") +
|
||||
scale_x_discrete(name = "Marker") +
|
||||
labs(color = "Variant") +
|
||||
scale_x_discrete(name = "Fault Type") +
|
||||
labs(
|
||||
color = "Variant",
|
||||
title = "Fault Count Ratios"
|
||||
) +
|
||||
theme_minimal() +
|
||||
theme(axis.text.x = element_text(angle = 45, hjust = 1))
|
||||
theme(
|
||||
axis.text.x = element_text(angle = 90, hjust = 1),
|
||||
plot.title = element_text(size = 14, face = "bold")
|
||||
)
|
||||
|
||||
ggsave(
|
||||
"injections/ratio_comparison_merged.svg",
|
||||
"injections/ratio_comparison_merged_trap.svg",
|
||||
plot = plot,
|
||||
width = 12,
|
||||
height = 8
|
||||
)
|
||||
print("Saved ratio_comparison_merged.svg")
|
||||
print("Saved ratio_comparison_merged_trap.svg")
|
||||
|
||||
Reference in New Issue
Block a user