minor bug fixes to allow i_graps for stability to render correctly
This commit is contained in:
parent
1f7eb6483d
commit
92fd905dea
1 changed files with 19 additions and 16 deletions
|
@ -15,39 +15,42 @@ theme_set(theme_grey())
|
||||||
## ...opt args
|
## ...opt args
|
||||||
#==========================================================
|
#==========================================================
|
||||||
stability_count_bp <- function(plotdf
|
stability_count_bp <- function(plotdf
|
||||||
, df_colname
|
, df_colname = ""
|
||||||
, leg_title = "Legend title"
|
, leg_title = "Legend Title"
|
||||||
, axis_text_size = 25
|
, ats = 25 # axis text size
|
||||||
, axis_label_size = 22
|
, als = 22 # axis label size
|
||||||
, leg_text_size = 20
|
, lts = 20 # legend text size
|
||||||
, leg_title_size = 22
|
, ltis = 22 # label title size
|
||||||
|
, geom_ls = 10 # geom_label size
|
||||||
, yaxis_title = "Number of nsSNPs"
|
, yaxis_title = "Number of nsSNPs"
|
||||||
, bp_plot_title = ""
|
, bp_plot_title = ""
|
||||||
, label_categories = c("Destabilising", "Stabilising")
|
, label_categories = c("Destabilising", "Stabilising")
|
||||||
, title_colour = "chocolate4"
|
, title_colour = "chocolate4"
|
||||||
, subtitle_text = NULL
|
, subtitle_text = NULL
|
||||||
, subtitle_size = 20
|
, sts = 20
|
||||||
, subtitle_colour = "pink"
|
, subtitle_colour = "pink"
|
||||||
#, leg_position = c(0.73,0.8) # within plot area
|
#, leg_position = c(0.73,0.8) # within plot area
|
||||||
, leg_position = "top"){
|
, leg_position = "top"){
|
||||||
|
|
||||||
OutPlot_count = ggplot(plotdf, aes(x = eval(parse(text = df_colname)))) +
|
# OutPlot_count = ggplot(plotdf, aes(x = eval(parse(text = df_colname)))) +
|
||||||
|
OutPlot_count = ggplot(plotdf, aes_string(x = df_colname)) +
|
||||||
geom_bar(aes(fill = eval(parse(text = df_colname))), show.legend = TRUE) +
|
geom_bar(aes(fill = eval(parse(text = df_colname))), show.legend = TRUE) +
|
||||||
geom_label(stat = "count"
|
geom_label(stat = "count"
|
||||||
, aes(label = ..count..)
|
, aes(label = ..count..)
|
||||||
, color = "black"
|
, color = "black"
|
||||||
, show.legend = FALSE
|
, show.legend = FALSE
|
||||||
, size = 10) +
|
, size = geom_ls) +
|
||||||
theme(axis.text.x = element_blank()
|
theme(axis.text.x = element_blank()
|
||||||
, axis.title.x = element_blank()
|
, axis.title.x = element_blank()
|
||||||
, axis.title.y = element_text(size = axis_label_size)
|
, axis.title.y = element_text(size = als)
|
||||||
, axis.text.y = element_text(size = axis_text_size)
|
, axis.text.y = element_text(size = ats)
|
||||||
, legend.position = leg_position
|
, legend.position = leg_position
|
||||||
, legend.text = element_text(size = leg_text_size)
|
, legend.text = element_text(size = lts)
|
||||||
, legend.title = element_text(size = leg_title_size)
|
, legend.title = element_text(size = ltis)
|
||||||
, plot.title = element_text(size = axis_label_size
|
, plot.title = element_text(size = als
|
||||||
, colour = title_colour)
|
, colour = title_colour
|
||||||
, plot.subtitle = element_text(size = subtitle_size
|
, hjust = 0.5)
|
||||||
|
, plot.subtitle = element_text(size = sts
|
||||||
, hjust = 0.5
|
, hjust = 0.5
|
||||||
, colour = subtitle_colour)) +
|
, colour = subtitle_colour)) +
|
||||||
labs(title = bp_plot_title
|
labs(title = bp_plot_title
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue