R/theme_savara.R

Defines functions theme_savara

Documented in theme_savara

#' Custom ggplot theme for Savara
#'
#' Modification of ggplot2 theme_grey with modifications to test size, legend position,
#'  and colors.
#'
#' @param base_size integer
#' @param base_family character
#'
#' @return
#' @export
#' @importFrom ggplot2 theme_bw
#' @examples
#' ggplot(mtcars, aes(x = factor(cyl), y = mpg, fill = factor(cyl))) + geom_boxplot() + theme_savara()
theme_savara <- function(base_size = 12, base_family = ""){
  theme_grey(base_size = base_size, base_family = base_family) %+replace%
    theme(
      axis.line = element_line(colour = 'black', size=0.5, linetype='solid'),
      axis.text = element_text(size = rel(.8)),
      axis.title = element_text(size = rel(1)),
      axis.ticks = element_line(color = 'black'),
      legend.key = element_blank(),
      legend.position = "top",
      legend.text = element_text(size = rel(1)),
      panel.background  = element_rect(fill = "white", colour = NA),
      panel.grid = element_blank(),
      panel.spacing = unit(1, "lines"),
      strip.background = element_blank()
    )
}
cotswold66/ggplotjl documentation built on March 20, 2020, 12:44 a.m.