theme_pomological: Pomological Theme

Description Usage Arguments Functions Fonts References See Also Examples

View source: R/theme_pomological.R

Description

ggplot2 plot theme based on the USDA Pomological Watercolors paintings.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
theme_pomological(
  base_family = NULL,
  base_size = 11,
  text.color = pomological_base$dark_blue,
  plot.background.color = pomological_base$paper,
  panel.border.color = pomological_base$light_line,
  with.panel.grid = FALSE,
  panel.grid.color = pomological_base$light_line,
  panel.grid.linetype = "dashed",
  axis.text.color = pomological_base$medium_line,
  axis.text.size = base_size * 3/4,
  base_theme = ggplot2::theme_minimal()
)

theme_pomological_nobg(..., plot.background.color = "transparent")

theme_pomological_plain(
  base_family = "",
  base_size = 11,
  plot.background.color = "transparent",
  ...
)

theme_pomological_fancy(base_family = "Homemade Apple", base_size = 16, ...)

Arguments

base_family

Base text family. See Fonts in theme_pomological() for some examples from Google Fonts options, including "Mr De Haviland", "Homemade Apple", "Marck Script", and "Mr. Bedfort". For the authentic pomological look, use "Homemade Apple" or "Mr De Haviland". Set to NULL or use theme_pomological_plain() for no change to fonts.

base_size

Base text size

text.color

Color of all text (except axis text, see axis.text.color)

plot.background.color

Color of plot background, passed to plot.background

panel.border.color

Color of plot panel border

with.panel.grid

If FALSE gridlines in plot are removed

panel.grid.color, panel.grid.linetype

Color and linetype of panel grid, passed to panel.grid

axis.text.color, axis.text.size

Color and size of axis text

base_theme

Starting theme of plot, default is ggplot2::theme_minimal(). Any elements set by theme_pomological() will overwrite the base_theme unless the specific parameter is explicitly set to NULL.

Functions

Fonts

Complete the pomological watercolor theme with a handwriting or cursive font. The following fonts from Google Fonts work well. Visit the links below to install on your system.

Fonts with R are notoriously tricky, so these may not work well for you. If you have installed the fonts but they aren't showing up or working, you can always try running extrafont::font_import() or extrafont::load_fonts() in the session or RMarkdown document. Or you can use theme_pomological_plain().

References

https://usdawatercolors.nal.usda.gov/pom

See Also

ggplot2::theme

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
library(ggplot2)

# Prep msleep data
msleep <- ggplot2::msleep[, c("vore", "sleep_rem", "sleep_total")]
msleep <- msleep[complete.cases(msleep), ]
msleep$vore <- paste0(msleep$vore, "vore")

# Base plot
basic_msleep_plot <- ggplot(msleep) +
  aes(x = sleep_rem, y = sleep_total, color = vore) +
  geom_point(size = 2) +
  labs(color = NULL)

# Just your standard ggplot
basic_msleep_plot 

# With pomological colors
basic_msleep_plot <- basic_msleep_plot + scale_color_pomological()
basic_msleep_plot

# With pomological theme
basic_msleep_plot + theme_pomological()

# With transparent background
basic_msleep_plot + theme_pomological_plain() 

# Or with "fancy" pomological settings
pomological_msleep <- basic_msleep_plot + theme_pomological_fancy()

# Painted!
paint_pomological(pomological_msleep, res = 110)

gadenbuie/ggpomological documentation built on June 17, 2020, 7:56 p.m.