From 453c834566e2dcf827b0795e8bcbaa2e8766fde5 Mon Sep 17 00:00:00 2001 From: Bryan Roessler Date: Wed, 25 Sep 2024 19:24:29 -0400 Subject: [PATCH] Copy original theme eactly and apply to plots --- qhtcp-workflow/apps/r/calculate_interaction_zscores.R | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/qhtcp-workflow/apps/r/calculate_interaction_zscores.R b/qhtcp-workflow/apps/r/calculate_interaction_zscores.R index dd1c6b8d..94b63827 100644 --- a/qhtcp-workflow/apps/r/calculate_interaction_zscores.R +++ b/qhtcp-workflow/apps/r/calculate_interaction_zscores.R @@ -93,10 +93,9 @@ theme_publication <- function(base_size = 14, base_family = "sans", legend_posit theme( plot.title = element_text(face = "bold", size = rel(1.2), hjust = 0.5), text = element_text(), - panel.border = element_rect(colour = NA), panel.background = element_rect(colour = NA), - panel.border = element_rect(colour = NA), plot.background = element_rect(colour = NA), + panel.border = element_rect(colour = NA), axis.title = element_text(face = "bold", size = rel(1)), axis.title.y = element_text(angle = 90, vjust = 2), axis.title.x = element_text(vjust = -0.2), @@ -108,7 +107,7 @@ theme_publication <- function(base_size = 14, base_family = "sans", legend_posit legend.key = element_rect(colour = NA), legend.position = legend_position, legend.direction = ifelse(legend_position == "right", "vertical", "horizontal"), - legend.key.size = unit(0.2, "cm"), + legend.key.size = unit(0.5, "cm"), legend.spacing = unit(0, "cm"), legend.title = element_text(face = "italic"), plot.margin = unit(c(10, 5, 5, 5), "mm"), @@ -395,7 +394,7 @@ generate_and_save_plots <- function(out_dir, filename, plot_configs, grid_layout } # Start building the plot with aes_mapping - plot_base <- ggplot(df, aes_mapping) + plot_base <- ggplot(df, aes_mapping) + theme_publication() # Use appropriate helper function based on plot type plot <- switch(config$plot_type,