🍑 ggpomological: A Pomological ggplot2 Theme

Project Links: source, readme

A brief history

Aron Atkins (@aronatkins) gave a great talk at rstudio::conf 2018 about a subject near and dear to my heart: parameterized RMarkdown. And apples.

In his talk, he designed a parameterized RMarkdown report that would provide the user with a customized report for their selected fruit and pulling in images from the USDA Pomological Watercolor Collection. I had never heard of the pomological watercolors – or the fan club twitter account @pomological – until watching his talk. It’s a treasure trove of thousands of watercolor images of fruits; beautiful images with intricate details and a very unique and stunning palette. The perfect palette for a custom ggplot2 theme.

The collection spans the years 1886 to 1942. The majority of the paintings were created between 1894 and 1916. The plant specimens represented by these artworks originated in 29 countries and 51 states and territories in the U.S. There are 7,497 watercolor paintings, 87 line drawings, and 79 wax models created by approximately 21 artists. [USDA National Agricultural Library]

I pulled together a small set of functions into a simple package called ggpomological that provides a custom, pomological-inspired ggplot2 theme.

Before reading more about ggpomological, you should really check out Aron’s talk or his slides.


ggpomological lives on GitHub for now (and probably ever), so you’ll need to use the devtools (or similar) to install:

# if you don't have devtools


Color Palette

The first thing I did after watching Aron’s talk was to browse through the pomological watercolors collection, downloading images of a wide variety of fruits. I didn’t do this in any systematic way, other than occasionally searching for a particular type of fruit, like “grape” or “papaya”.

From these images, I used an application (that I installed forever ago and apparently is no longer around) called ColorSchemer Studio to pull out a set of colors that I felt represented the collection.

I ended up with a lot of colors.

From this list, I chose just a few that I thought worked well together for color and fill scales


and a few colors for the plot background and decoration


Setup theme and scales

I created three variants of the theme-generating function theme_pomological().

  • theme_pomological() sets the plot theme to be representative of the paper and styling of the watercolors and includes a paper-colored background,

  • theme_pomological_plain() has the same styling, just with a transparent (or white) background,

  • theme_pomological_fancy() has the paper-colored background and defaults to a fancy handwritten font (Homemade Apple).

For color and fill scales, ggpomological provides scale_color_pomological() and scale_fill_pomological().

In the future, I might revisit this package to

  1. Increase colors in discrete scale

  2. Setup paired color scales as there are lots of great color pairs in the extracted colors

  3. Set up continuous scale colors.


To get the fully authentic pomological look you really need a handwritten font style, and I found a few from Google Fonts that fit the bill.

Alternatively, you can use something like calligrapher.com to create your own handwriting font!

But fonts can be painful in R, so the base functions – theme_pomological() and theme_pomological_plain() – don’t change the font by default. To opt into the full pomological effect, use theme_pomological_fancy() which is just an alias for theme_pomological(base_family = "Homemade Apple", base_size = 16).

Add paper background!

Great, but I want my plots to look even more pomological, you say?

Perfect! ggpomological provides a function named paint_pomological that uses the magick package to add a pomological watercolor paper background and a subtle texture overlay.

Demo time!

We’ll need ggplot2 (loaded with ggpomological) and dplyr


Basic iris plot

# Base plot
basic_iris_plot <- ggplot(iris) +
  aes(x = Sepal.Length, y = Sepal.Width, color = Species) +
  geom_point(size = 2)

# Just your standard Iris plot

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

# With pomological theme
basic_iris_plot + theme_pomological()

# With transparent background
basic_iris_plot + theme_pomological_plain() 

# Or with "fancy" pomological settings
pomological_iris <- basic_iris_plot + theme_pomological_fancy()

# Painted!
paint_pomological(pomological_iris, res = 110) %>% 

Stacked bar chart

stacked_bar_plot <- ggplot(diamonds) +
  aes(price, fill = cut) +
  geom_histogram(binwidth = 850) + 
  xlab('Price (USD)') + 
  ylab('Count') + 
  ggtitle("ggpomological") +
  scale_x_continuous(label = scales::dollar_format()) +

stacked_bar_plot + theme_pomological("Homemade Apple", 16)

  stacked_bar_plot + theme_pomological_fancy(),
  res = 110
) %>% 

Density Plot

density_plot <- mtcars %>% 
  mutate(cyl = factor(cyl)) %>% 
  ggplot() +
  aes(mpg, fill = cyl, color = cyl)+
  geom_density(alpha = 0.75) + 
  labs(fill = 'Cylinders', colour = 'Cylinders', x = 'MPG', y = 'Density') +
  scale_color_pomological() +

density_plot + theme_pomological("Homemade Apple", 16)

  density_plot + theme_pomological_fancy(),
  res = 110
) %>% 

Points and lines

Here I’ll use the txhousing data provided with ggplot2

Information about the housing market in Texas provided by the TAMU real estate center, http://recenter.tamu.edu/.

big_volume_cities <- txhousing %>% 
  group_by(city) %>% 
  summarize(mean_volume = mean(volume, na.rm = TRUE)) %>% 
  arrange(-mean_volume) %>% 
  top_n(length(ggpomological:::pomological_palette)) %>% 

full_bar_stack_plot <- txhousing %>% 
  filter(city %in% big_volume_cities) %>% 
  group_by(city, year) %>% 
  summarize(mean_volume = mean(volume, na.rm = TRUE)) %>% 
  ungroup %>% 
  mutate(city = factor(city, big_volume_cities)) %>% 
  ggplot() +
  aes(year, mean_volume, fill = city, group = city) +
  geom_col(position = 'fill', width = 0.9) +
  labs(x = 'City', y = 'Mean Volume', color = 'City') +
  theme(panel.grid.minor.x = element_blank()) +

full_bar_stack_plot + theme_pomological("Homemade Apple", 16)

  full_bar_stack_plot + theme_pomological_fancy(),
  res = 110
) %>% 

One last plot

This last one is in my own handwriting.

ridges_pomological <- ggplot(diamonds) + 
  aes(x = carat, y = clarity, color = clarity, fill = clarity) + 
  ggridges::geom_density_ridges(alpha = 0.75) + 
    base_family = 'gWriting',
    base_size = 20,
    base_theme = ggridges::theme_ridges()
    ) + 
  scale_fill_pomological() + 

paint_pomological(ridges_pomological, res = 110) %>%