Skip to contents

maison is the presentation layer for my research work: one ggplot2 theme, its palettes and scales, and a matching tinytable theme. This page shows what it does with as little code as possible. For full chart recipes, see vignette("gallery").

One call in the setup chunk

library(ggplot2)
library(maison)

set_maison(base_family = "sans")

set_maison() makes theme_maison() the default ggplot2 theme and theme_maison_tt() the default tinytable theme. That is all it changes: no global geom defaults and no ggplot2 options. Every chart and table after it is in the house style.

In your own work, leave out base_family; the default is the house font. This page uses "sans" so it builds anywhere.

sales <- data.frame(
  region = c("North", "South", "East", "West"),
  units = c(42, 31, 27, 18)
)

ggplot(sales, aes(region, units)) +
  geom_col() +
  labs(title = "The North sells the most", subtitle = "Units sold, thousands", x = NULL, y = NULL)

The bars are plum, the title is flush left, and there are no axis ticks and no vertical gridlines. None of that is in the chart’s code.

Add theme_maison() to a single chart only when it needs an argument. The most common one is grid = "X" for horizontal bars, so the gridlines run along the values:

ggplot(sales, aes(units, region)) +
  geom_col() +
  labs(title = "The North sells the most", x = NULL, y = NULL) +
  theme_maison(base_family = "sans", grid = "X")

Fonts

The house sans is Hanken Grotesk, with Newsreader and IBM Plex Mono for Tweed and Twill text and code. All three are free Google fonts. Check what is installed:

Any installed family works: set_maison(base_family = "Aktiv Grotesk"). If the family is missing, maison warns once and falls back to "sans". To see custom fonts in rendered figures, use a device that finds system fonts, such as ragg::agg_png() (dev = "ragg_png" in knitr).

Colors and palettes

maison_colors holds every house color by name. Use names, not hex codes:

maison_colors[c("plum", "red", "olive", "warm_white")]
#>       plum        red      olive warm_white 
#>  "#463752"  "#C0292D"  "#807B6C"  "#FAF9F7"

Red is reserved for the one thing a chart wants you to see, so it is in no palette. These are the palettes:

maison_pal("seq_cobalt")(5) returns any palette as hex codes.

Scales

The theme already colors a discrete fill with the categorical palette and a continuous fill with seq_purple, so most charts need no scale call:

mix <- data.frame(
  wave = rep(c("Wave 1", "Wave 2", "Wave 3"), each = 3),
  segment = factor(rep(c("Loyal", "Switcher", "New"), 3), levels = c("Loyal", "Switcher", "New")),
  share = c(50, 30, 20, 46, 31, 23, 41, 33, 26)
)

ggplot(mix, aes(wave, share, fill = segment)) +
  geom_col() +
  labs(title = "New buyers grow each wave", subtitle = "Share of buyers, percent", x = NULL, y = NULL)

Use a scale to pick another palette. Each takes the palette name first:

Data Scale
Unordered groups scale_fill_maison_d(), scale_colour_maison_d()
A continuous measure scale_fill_maison_c("seq_cobalt")
A measure with a meaningful middle scale_fill_maison_div(midpoint = 0)
An agreement scale (ordered factor) scale_fill_maison_likert(), always needed
One highlighted bar scale_fill_manual(values = maison_highlight(x, "Denver"))
grid_data <- expand.grid(x = 1:12, y = 1:4)
grid_data$value <- grid_data$x * grid_data$y

ggplot(grid_data, aes(x, factor(y), fill = value)) +
  geom_tile() +
  scale_fill_maison_c("seq_cobalt") +
  labs(title = "Any ramp is one scale away", x = NULL, y = NULL) +
  theme_maison(base_family = "sans", grid = "", legend_position = "none")

Tables

After set_maison(), every tinytable::tt() gets the house rules: hairline rows, a heavier closing rule, bold headers, the first column left and the rest right. Typeface and size come from the document’s stylesheet.

tinytable::tt(sales)
region units
North 42
South 31
East 27
West 18

Dark slides

dark = TRUE draws on charcoal with warm white text and switches discrete fills to categorical_dark, six colors that stay readable on charcoal. Use it on one chart with theme_maison(dark = TRUE), or for a whole dark deck with set_maison(dark = TRUE), which also sets the table rules for dark slides.

ggplot(mix, aes(wave, share, fill = segment)) +
  geom_col() +
  labs(title = "New buyers grow each wave", x = NULL, y = NULL) +
  theme_maison(base_family = "sans", dark = TRUE)

Transparent background

background = "transparent" removes the plot background, so a chart sits on any slide color and prints clean. The graphics device has to keep the transparency too. In knitr and Quarto, set the chunk option dev.args = list(bg = "transparent"):

```{r}
#| dev.args: !expr list(bg = "transparent")
p + theme_maison(background = "transparent")
```

For a whole document, pass it once: set_maison(background = "transparent"). The chart below is drawn that way and placed on a gray block.

ggplot(sales, aes(units, region)) +
  geom_col() +
  labs(title = "The North sells the most", x = NULL, y = NULL) +
  theme_maison(base_family = "sans", grid = "X", background = "transparent")

Next

vignette("gallery") has the chart types we use on client work, with the house rules and code you can copy.