R/plot_themes.R

Defines functions single_bar_theme single_line_theme top_performer_theme

#' Base theme for top performer figures
#' @importFrom ggplot2 theme element_blank element_text unit theme_classic
top_performer_theme <- function(){
  theme_classic() +
    theme(axis.line=element_blank(),
          axis.text.x=element_blank(),
          axis.text.y=element_blank(),
          axis.ticks=element_blank(),
          axis.title.x=element_blank(),
          axis.title.y=element_blank(),
          legend.position="none",
          panel.background=element_blank(),
          panel.border=element_blank(),
          panel.grid.major=element_blank(),
          panel.grid.minor=element_blank(),
          plot.margin = unit(c(-.1,-.1,-.1,-.1),"npc") )
}

#' @importFrom ggplot2 theme element_blank element_text unit theme_classic
single_line_theme <- function(){
  theme_classic() +
    theme(axis.ticks=element_blank(),
          axis.title.x=element_blank(),
          axis.text = element_text(color="#00274c"),
          axis.title.y=element_blank(),
          panel.background=element_blank(),
          panel.border=element_blank(),
          panel.grid.major=element_blank(),
          panel.grid.minor=element_blank(),
          legend.position = "none")
}

# Removes grid and provides correct axis style
# (missing y-axis ticks on actual axis)
#' @importFrom ggplot2 theme element_blank element_text unit theme_classic
single_bar_theme <- function(){
  theme_classic() +
    theme(axis.ticks=element_blank(),
          axis.title.x=element_blank(),
          axis.text = element_text(color=MR$DL_BLUE),
          axis.title.y=element_blank(),
          panel.background=element_blank(),
          panel.border=element_blank(),
          panel.grid.major=element_blank(),
          panel.grid.minor=element_blank(),
          plot.background=element_blank(),
          legend.position = "bottom",
          legend.title = element_blank(),
          legend.box.spacing = unit(0,"mm"),
          legend.key.size = unit(4, "mm"),
          legend.text = element_text(size=8)
          )
}
Display-Lab/micca-report documentation built on Dec. 23, 2020, 8:44 a.m.