R/pcvtheme.R

Defines functions pcv_theme

Documented in pcv_theme

#' Default theme for ggplots made by pcvr functions.
#'
#' @import ggplot2
#' @importFrom ggplot2 %+replace%
#' @return A ggplot theme
#' @examples
#' ggplot2::ggplot() +
#'   pcv_theme()
#' @export
#'
pcv_theme <- function() {
  thm <- ggplot2::theme_minimal() %+replace%
    ggplot2::theme(
      axis.text.x.bottom = ggplot2::element_text(hjust = 1),
      axis.line.y.left = ggplot2::element_line(),
      axis.line.x.bottom = ggplot2::element_line(),
      strip.background = ggplot2::element_rect(fill = "gray50", color = "gray20"),
      strip.text.x = ggplot2::element_text(size = 14, color = "white"),
      strip.text.y = ggplot2::element_text(size = 14, color = "white")
    )
  return(thm)
}

Try the pcvr package in your browser

Any scripts or data that you put into this service are public.

pcvr documentation built on April 16, 2025, 5:12 p.m.