dadded v2 of barplot layput

This commit is contained in:
Tanushree Tunstall 2022-08-14 22:56:08 +01:00
parent da8f8d90d4
commit 7c40e13771
7 changed files with 800 additions and 79 deletions

View file

@ -26,14 +26,15 @@ site_snp_count_bp <- function (plotdf
, df_colname = "position"
#, bp_plot_title = ""
#, leg_title = "Legend title"
, leg_text_size = 20
, axis_text_size = 25
, axis_label_size = 22
, leg_text_size = 10#20
, axis_text_size = 10#25
, axis_label_size = 10#22
, subtitle_size = 10#20
, geom_ls = 10
, xaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of Sites"
, title_colour = "chocolate4"
, subtitle_text = NULL
, subtitle_size = 20
, subtitle_colour = "pink")
{
@ -131,7 +132,7 @@ site_snp_count_bp <- function (plotdf
scale_x_continuous(breaks = unique(snpsBYpos_df$snpsBYpos)) +
geom_label(stat = "count", aes(label = ..count..)
, color = "black"
, size = 10) +
, size = geom_ls) +
theme(axis.text.x = element_text(size = axis_text_size
, angle = 0)
, axis.text.y = element_text(size = axis_text_size
@ -148,10 +149,15 @@ site_snp_count_bp <- function (plotdf
, plot.subtitle = element_text(size = subtitle_size
, hjust = 0.5
, colour = subtitle_colour)) +
labs(title = bp_plot_title
, subtitle = subtitle_text
, x = xaxis_title
, y = yaxis_title)
# labs(title = bp_plot_title
# , subtitle = subtitle_text
# , x = xaxis_title
# , y = yaxis_title)
labs(title = ""
, subtitle = bp_plot_title
, x = xaxis_title
, y = yaxis_title)
}
########################################################################

View file

@ -17,17 +17,17 @@ theme_set(theme_grey())
stability_count_bp <- function(plotdf
, df_colname = ""
, leg_title = ""
, ats = 25 # axis text size
, als = 22 # axis label size
, lts = 20 # legend text size
, ltis = 22 # label title size
, ats = 12#25 # axis text size
, als = 11#22 # axis label size
, lts = 10#20 # legend text size
, ltis = 11#22 # label title size
, geom_ls = 10 # geom_label size
, yaxis_title = "Number of nsSNPs"
, bp_plot_title = ""
, label_categories #= c("LEVEL1", "LEVEL2")
, title_colour = "chocolate4"
, subtitle_text = NULL
, sts = 20
, sts = 10#20
, subtitle_colour = "#350E20FF" #brown
#, leg_position = c(0.73,0.8) # within plot area
, leg_position = "top"
@ -45,7 +45,10 @@ stability_count_bp <- function(plotdf
, aes(label = ..count..)
, color = "black"
, show.legend = FALSE
, size = geom_ls) +
, size = geom_ls
#, nudge_x = 0
#, nudge_y = -1
, label.size = 0.25 ) +
theme(axis.text.x = element_blank()
, axis.title.x = element_blank()
, axis.title.y = element_text(size = als)
@ -53,6 +56,7 @@ stability_count_bp <- function(plotdf
, legend.position = leg_position
, legend.text = element_text(size = lts)
, legend.title = element_text(size = ltis)
, legend.key.size = unit(lts,"pt")
, plot.title = element_text(size = als
, colour = title_colour
, hjust = 0.5)