R/theme_camprot.R

Defines functions theme_camprot

Documented in theme_camprot

#' ggplot theme for package
#'
#' @description A standard theme to use for plots generated by this package
#'
#' @param base_size base font size, given in pts.
#' @param base_family base font family
#' @param aspect_square set aspect.ratio to 1
#' @param border include a border
#'
#' @return theme
#' @export
#'
theme_camprot <- function(base_size=20, base_family='serif',
                          aspect_square=TRUE, border=TRUE){

  camprot_theme <- theme_bw(base_size=base_size,
                            base_family=base_family) +
    theme(panel.grid=element_blank(),
          panel.background = element_blank())

  if(aspect_square){
    camprot_theme <- camprot_theme + theme(aspect.ratio=1)
  }

  if(!border){
    camprot_theme <- camprot_theme + theme(
      panel.border = element_blank(),
      axis.line = element_line(colour = "black", linewidth=0.5))
  }

  camprot_theme
}
CambridgeCentreForProteomics/camprotR documentation built on July 7, 2024, 2:13 a.m.