% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/UserFacingCoreFunctions.R
\name{theme_plus}
\alias{theme_plus}
\title{A Universal Design-Oriented Base Ggplot2 Theme With Scalable and Overridable Defaults}
\usage{
theme_plus(
  ...,
  legend_pos = "top",
  base_font_size = 16,
  base_linewidth = 1.2,
  base_rectlinewidth = 1.2,
  line_color = "black",
  text_color = "black",
  background_color = "#FFFEFD",
  palette_discrete = "D",
  palette_continuous = "E",
  begin_discrete = 0,
  end_discrete = 0.72,
  begin_continuous = 0,
  end_continuous = 1,
  export_width = 7.25,
  export_height = 5.95,
  override_legend_alphasize = TRUE,
  enable_coaching = TRUE
)
}
\arguments{
\item{...}{Optional additional theme settings passed to \code{\link[ggplot2:theme]{ggplot2::theme()}}. These are applied \emph{after} the base theme, so the theme's defaults only "win" when no matching settings are provided by the user
(same as in ggplot2).}

\item{legend_pos}{Where to put the legend. \code{"top"} (default) creates a
horizontal stripe at the top for the legend (box) when one is present;
\code{"right"} uses a vertical legend at the right (ggplot2’s usual position)
but with design modifications. \code{"bottom"} is also an option (largely same
as \code{"top"}).}

\item{base_font_size}{Base text size (in points) for most text elements. These
will scale via \code{rel()}. Default is \code{16}.}

\item{base_linewidth}{Baseline thickness for most \strong{line} theme elements
(e.g., axis lines and tick marks). Defaults to \code{1.2}. Specific elements
may use \code{rel()} multipliers on top of this.}

\item{base_rectlinewidth}{Baseline line thickness for most \strong{rect} theme elements
(e.g., legend frames). Defaults to \code{1.2}.}

\item{line_color}{Default color for most line elements (axis lines, frames, etc.).
Defaults to \code{"black"}.}

\item{text_color}{Default color for most text elements. Defaults to \code{"black"}.}

\item{background_color}{Background fill applied to the panel, plot, legend,
and strip backgrounds. Defaults to a slightly warm white, \code{"#FFFEFD"}, to reduce eyestrain.}

\item{palette_discrete, palette_continuous}{Default viridis-family color palette codes ("A" through "H") to use for discrete and continuous scales, respectively.}

\item{begin_discrete, end_discrete, begin_continuous, end_continuous}{Numeric values ranging between 0 and 1 for where to begin drawing colors from a viridis palette for a discrete and continuous color scale, respectively.}

\item{export_width, export_height}{Length-1 numeric values indicating your intended export (most likely via ggplot2::ggsave()) width and height, respectively. This rescales font and line sizes internally to stay relatively appropriately for your intended export size.}

\item{override_legend_alphasize}{Logical indicating whether, for any fill, color, and/or shape legends, to override the size and/or alpha values to the ggplotplus default values (1 and 5, respectively). Defaults to TRUE.}

\item{enable_coaching}{Logical indicating whether ggplotplus should perform certain automated checks for possible non-Universal graph design and provide coaching messages when these are detected. Defaults to TRUE.}
}
\value{
A ggplot2 theme object to add with \code{+}.
}
\description{
\code{theme_plus()} returns a ggplot2 theme designed to make
publication-quality, accessible graphs easier to produce. It keeps all of
ggplot2’s normal behaviors (last theme wins; user overrides take precedence),
but bakes in opinionated defaults with Universal Design in mind. A few knobs
let you scale typography/lines, flip the legend layout, and switch the
background color if desired.
}
\details{
Internally, text sizes are expressed with \code{rel()}, so they scale with
\code{base_font_size}. Line/rect line thicknesses start from \code{base_linewidth} and
\code{base_rectlinewidth} and scale similarly with \code{rel()}.

The function builds
a  base theme, then \emph{adds} any user overrides via
\code{theme(...)}, so the user's preferences always take precedence.
}
\examples{
# Basic use
library(ggplot2)
ggplot(iris, aes(Sepal.Length, Petal.Length, colour = Species)) +
  geom_point() +
  theme_plus()

# Prefer the right-side legend and pure white background
ggplot(mtcars, aes(wt, mpg)) +
  geom_point() +
  theme_plus(legend_pos = "right", background_color = "white")

# Scale text up and make lines a bit lighter
ggplot(iris, aes(Sepal.Length, Petal.Length)) +
  geom_point() +
  theme_plus(base_font_size = 18, base_linewidth = 1.0)

# You can still override any element normally via theme()
ggplot(iris, aes(Sepal.Length, Petal.Length)) +
  geom_point() +
  theme_plus() +
  theme(axis.line = element_line(linewidth = 0.8))

# But you could just as easily do so via theme_plus()
ggplot(iris, aes(Sepal.Length, Petal.Length)) +
  geom_point() +
  theme_plus(axis.line = element_line(linewidth = 0.8))

}
\seealso{
\code{\link[ggplot2:theme]{ggplot2::theme()}}, \code{\link[ggplot2:ggtheme]{ggplot2::theme_gray()}}, \code{\link[ggplot2:get_theme]{ggplot2::theme_get()}}
}
