Basic penngradlings theme template
Usage
theme_pgl_minimal(
base_size = 12,
axis_lines = "",
grid_lines = "xy",
grid_lines_minor = FALSE,
outline_color = "#1F1C1C"
)
Arguments
- base_size
Base size for text elements
- axis_lines
Which axis lines should be drawn, passed as a string.
- grid_lines
Which grid lines should be drawn, passed as a string.
- grid_lines_minor
Whether minor grid lines should be draw. Defaults to
FALSE
- outline_color
Primary color for text, line, and rectangle outline.
Value
A theme object created by theme()
Examples
# \dontrun{
library(ggplot2)
ggplot(iris, aes(Petal.Length, Petal.Width, color = Species)) +
geom_point(size = 2) +
labs(
title = "Petal profile of plant species in the iris dataset",
subtitle = "Virginica has the largest petal of the three species"
) +
facet_wrap(~Species) +
theme_pgl_minimal(base_size = 11)
ggplot(diamonds, aes(cut, price, fill = cut)) +
stat_summary(geom = "bar", fun = "mean", width = 0.8) +
scale_y_continuous(
expand = expansion(c(0, 0.1)),
labels = ~ paste0("$", .x)
) +
scale_fill_manual(values = pgl_pals("christine", "blueberry_boba")) +
labs(
title = "Price of diamonds by cut quality",
subtitle = "This is a bad explanatory plot because carat (size) is a confounding variable",
x = NULL, y = NULL,
caption = "diamonds dataset from {ggplot2}"
) +
theme_pgl_minimal(axis_lines = "x", grid_lines = "y")
#> Error in f(...): Insufficient values in manual scale. 5 needed but only 1 provided.
# }