From 285b28b1d64c6973e2347137d4ba89c7f6e9a3e9 Mon Sep 17 00:00:00 2001 From: Tanushree Tunstall Date: Wed, 10 Aug 2022 11:06:05 +0100 Subject: [PATCH] various plots --- scripts/functions/bp_subcolours.R | 3 ++- scripts/functions/wideP_consurf.R | 20 +++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/scripts/functions/bp_subcolours.R b/scripts/functions/bp_subcolours.R index 99d67b1..2be5e9b 100755 --- a/scripts/functions/bp_subcolours.R +++ b/scripts/functions/bp_subcolours.R @@ -123,7 +123,8 @@ bp_stability_hmap <- function(plot_df = merged_df3 #, axis.title.x = element_text(size = my_xaxts) , axis.title.y = element_text(size = my_yaxts ) , plot.title = element_text(size = my_pts - , hjust = 0.5)) + + , hjust = 0.5) + ) + labs(title = p_title , x = my_xlab diff --git a/scripts/functions/wideP_consurf.R b/scripts/functions/wideP_consurf.R index 23c7d30..9f7421a 100644 --- a/scripts/functions/wideP_consurf.R +++ b/scripts/functions/wideP_consurf.R @@ -34,8 +34,8 @@ wideP_consurf2 <- function(plot_df , "1": "Variable" , "2", "3", "4", "5", "6", "7", "8" , "9": "Conserved") - , panel_col = "white" - , panel_col_fill = "white" + , panel_col = "grey" + , panel_col_fill = "grey" # axes title and label sizes , x_axls = 12 # x-axis label size @@ -295,7 +295,10 @@ wideP_consurf2 <- function(plot_df , vjust = 0) , axis.title.x = element_text(size = x_axls) , axis.title.y = element_text(size = y_axls ) - , panel.background = element_rect(fill = panel_col_fill, color = panel_col) + , panel.background = element_rect(fill = panel_col_fill, color = "transparent") + , plot.background = element_rect(fill = panel_col_fill, color = "transparent") + , panel.grid = element_blank() + #, panel.grid.major = element_line(color = "black") #, panel.grid.minor = element_line(color = "black") , plot.title = element_text(size = pts @@ -315,8 +318,15 @@ wideP_consurf2 <- function(plot_df #Extract legend1 #------------------ # yayy - g1_leg = ggplot(plot_df, aes_string(x = sprintf("factor(%s)" - , xvar_colname) )) + g1_leg = ggplot(plot_df + , aes_string( + x = sprintf("factor(%s)" + , xvar_colname)) + , theme( + panel.background = element_rect(fill = panel_col_fill, color = "transparent") + , plot.background = element_rect(fill = panel_col_fill, color = "transparent") + + )) g1_leg = g1_leg + geom_bar(); g1_leg g1_leg = g1_leg + geom_bar(aes_string(fill = sprintf("factor(%s)" , yvar_colourN_colname)))