Make title size customizable

This commit is contained in:
2024-10-04 19:03:01 -04:00
parent bbf2d630b9
commit 876970924b

Vedi File

@@ -613,7 +613,12 @@ generate_and_save_plots <- function(out_dir, filename, plot_configs, page_width
)
# Add labels and title
if (!is.null(config$title)) plot <- plot + ggtitle(config$title)
if (!is.null(config$title)) {
plot <- plot + ggtitle(config$title)
if (!is.null(config$title_size)) {
plot <- plot + theme(plot.title = element_text(size = config$title_size))
}
}
if (!is.null(config$x_label)) plot <- plot + xlab(config$x_label)
if (!is.null(config$y_label)) plot <- plot + ylab(config$y_label)
if (!is.null(config$coord_cartesian)) plot <- plot + coord_cartesian(ylim = config$coord_cartesian)
@@ -1001,7 +1006,8 @@ generate_interaction_plot_configs <- function(df, type) {
x_var = "conc_num_factor_factor",
y_var = paste0("Delta_", var),
x_label = unique(group_data$Drug)[1],
title = paste(OrfRepTitle, Gene, num, sep = " "),
title = paste(OrfRepTitle, Gene, sep = " "),
title_size = rel(1.2),
coord_cartesian = y_limits,
annotations = list(
list(x = 1, y = y_limits[2] - 0.2 * y_span, label = paste("ZShift =", Z_Shift_value)),