R/ggLin.R

Defines functions theme_lin

Documented in theme_lin

#' Jennifer's ggplot2 Theme
#'
#' I find that I am copying and psting the same long command for
#' my favorite theme settings, so I figure I'd write that into this package
#' to simplify the process.
#'
#' The specifications of this theme is as follows: \cr
#' theme_classic()+   \cr
#' theme(   \cr
#' plot.title         = element_text(hjust = 0.5, size = 24, colour="black"),  \cr
#'  plot.subtitle      = element_text(hjust = 0.5, size = 18, colour="black"),  \cr
#'  legend.title       = element_text(hjust = 0.5, size = 16, colour="black"),  \cr
#'  plot.caption       = element_text(size = 12, colour="black"),  \cr
#'  axis.title         = element_text(size = 16, colour="black"),  \cr
#'  axis.text.x        = element_text(size = 14, colour="black"),  \cr
#'  axis.text.y        = element_text(size = 14, colour="black"),  \cr
#'  legend.title.align = 0.5)
#'
#'
#' @name ggLin
#'
#' @param ... Passed to [ggplot2::theme()]
#'
#' @examples
#' library(ggplot2)
#' ggplot(mtcars, aes(y=mpg, x=disp, color=cyl)) +
#'   geom_point() +
#'   theme_lin()
#'
#'
#' @importFrom ggplot2 ggplot
#' @importFrom ggplot2 theme_classic
#' @importFrom ggplot2 theme
#' @export
theme_lin <- function(...){
  theme_classic()+
    theme(
      plot.title         = element_text(hjust = 0.5, size = 24, colour="black"),
      plot.subtitle      = element_text(hjust = 0.5, size = 18, colour="black"),
      legend.title       = element_text(hjust = 0.5, size = 16, colour="black"),
      plot.caption       = element_text(size = 12, colour="black"),
      axis.title         = element_text(size = 16, colour="black"),
      axis.text.x        = element_text(size = 14, colour="black"),
      axis.text.y        = element_text(size = 14, colour="black"),
      legend.title.align = 0.5)
}
lin-jennifer/lin documentation built on Jan. 1, 2021, 8:21 a.m.