various plots

This commit is contained in:
Tanushree Tunstall 2022-08-10 11:06:05 +01:00
parent a6d93b3fa8
commit 285b28b1d6
2 changed files with 17 additions and 6 deletions

View file

@ -123,7 +123,8 @@ bp_stability_hmap <- function(plot_df = merged_df3
#, axis.title.x = element_text(size = my_xaxts) #, axis.title.x = element_text(size = my_xaxts)
, axis.title.y = element_text(size = my_yaxts ) , axis.title.y = element_text(size = my_yaxts )
, plot.title = element_text(size = my_pts , plot.title = element_text(size = my_pts
, hjust = 0.5)) + , hjust = 0.5)
) +
labs(title = p_title labs(title = p_title
, x = my_xlab , x = my_xlab

View file

@ -34,8 +34,8 @@ wideP_consurf2 <- function(plot_df
, "1": "Variable" , "1": "Variable"
, "2", "3", "4", "5", "6", "7", "8" , "2", "3", "4", "5", "6", "7", "8"
, "9": "Conserved") , "9": "Conserved")
, panel_col = "white" , panel_col = "grey"
, panel_col_fill = "white" , panel_col_fill = "grey"
# axes title and label sizes # axes title and label sizes
, x_axls = 12 # x-axis label size , x_axls = 12 # x-axis label size
@ -295,7 +295,10 @@ wideP_consurf2 <- function(plot_df
, vjust = 0) , vjust = 0)
, axis.title.x = element_text(size = x_axls) , axis.title.x = element_text(size = x_axls)
, axis.title.y = element_text(size = y_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.major = element_line(color = "black")
#, panel.grid.minor = element_line(color = "black") #, panel.grid.minor = element_line(color = "black")
, plot.title = element_text(size = pts , plot.title = element_text(size = pts
@ -315,8 +318,15 @@ wideP_consurf2 <- function(plot_df
#Extract legend1 #Extract legend1
#------------------ #------------------
# yayy # yayy
g1_leg = ggplot(plot_df, aes_string(x = sprintf("factor(%s)" g1_leg = ggplot(plot_df
, xvar_colname) )) , 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(); g1_leg
g1_leg = g1_leg + geom_bar(aes_string(fill = sprintf("factor(%s)" g1_leg = g1_leg + geom_bar(aes_string(fill = sprintf("factor(%s)"
, yvar_colourN_colname))) , yvar_colourN_colname)))