You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
2.9 KiB

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/theme-rc.R
\name{theme_rc}
\alias{theme_rc}
\title{ggplot2 Theme Based On The Roboto Condensed Font Family}
\usage{
theme_rc(
base_size = 10,
line_height = 0.875,
plot_title_size = 18,
plot_title_position = "panel",
plot_title_margin = 10,
subtitle_size = 12,
subtitle_margin = 12,
strip_text_size = 12,
strip_placement = "outer",
caption_size = 9,
caption_margin = 12,
axis_text_size = base_size,
axis_title_size = 9,
axis_title_just = "rt",
panel_spacing = grid::unit(2, "lines"),
plot_margin = margin(30, 30, 30, 30),
mode = c("light", "dark", "rstudio"),
background_colour = theme_background_color(mode, light = "white", dark = "#121212"),
foreground_colour = theme_foreground_color(mode, light = "#262626", dark = "#e1e1e1"),
grid_col = theme_foreground_color(mode, light = "#cccccc", dark = "#606367"),
axis_col = theme_foreground_color(mode, light = "#2b2b2b", dark = "#606367"),
grid = TRUE,
axis = FALSE,
axis_text = TRUE,
ticks = FALSE
)
}
\arguments{
\item{base_size}{base font size}
\item{line_height}{default line height}
\item{plot_title_size}{plot title size}
\item{plot_title_position}{plot title position}
\item{plot_title_margin}{plot title margin}
\item{subtitle_size}{subtitle size}
\item{subtitle_margin}{subtitle margin}
\item{strip_text_size}{strip text size}
\item{strip_placement}{strip placement}
\item{caption_size}{caption size}
\item{caption_margin}{caption margin}
\item{axis_text_size}{axis text size}
\item{axis_title_size}{axis title size}
\item{axis_title_just}{axis title just}
\item{panel_spacing}{panel spacing}
\item{plot_margin}{plot margin}
\item{grid_col}{grid col}
\item{axis_col}{axis col}
\item{grid}{grid}
\item{axis}{axis}
\item{axis_text}{axis text labels}
\item{ticks}{ticks}
\item{text_geom_size}{text geom size}
}
\value{
ggplot2 theme
}
\description{
Uses the built-in \link{rc_pkg} custom font.
}
\details{
\itemize{
\item \code{background_colour} dark mode is "\verb{#121212}" else "\code{white}"
\item \code{foreground_colour} dark mode is "\verb{#e1e1e1}" else "\verb{#262626}"
\item \code{grid_col} dark mode is "\verb{#606367}" else "\verb{#cccccc}"
\item \code{axis_col} dark mode is "\verb{#606367}" else "\verb{#2b2b2b}"
}
}
\note{
this function updates \code{Geom} defaults; use \code{\link[=reset_ggplot2_defaults]{reset_ggplot2_defaults()}} to
restore ggplot2 geom default aeshetics
}
\examples{
ggplot() +
geom_point(
data = mtcars,
aes(mpg, wt)
) +
geom_label(
aes(
x = 30, y = 4.5,
label = "A fairly useless\nannotation that\nuses the custom\nInter variant\nby default."
),
label.size = 0
) +
labs(
x = "Fuel efficiency (mpg)", y = "Weight (tons)",
title = "Seminal ggplot2 scatterplot example",
subtitle = "A plot that is only useful for demonstration purposes",
caption = "Brought to you by the letter 'g'"
) +
theme_rc(grid = "XY")
}