Skip to contents

See https://ethanschoonover.com/solarized/ for a description of the Solarized palette.

Usage

theme_solarized(base_size = 12, base_family = "", light = TRUE)

theme_solarized_2(base_size = 12, base_family = "", light = TRUE)

Arguments

base_size

base font size, given in pts.

base_family

base font family

light

If TRUE (the default), use the light theme; otherwise, use the dark theme.

Value

A ggplot2 theme object (class theme).

Details

Plots made with this theme integrate seamlessly with the Solarized Beamer color theme. https://github.com/jrnold/beamercolorthemesolarized. There are two variations: theme_solarized() is similar to ggplot2::theme_bw(), while theme_solarized_2() is similar to ggplot2::theme_gray().

Palettes

The theme sets solarized_pal() for discrete color and fill scales as the default palettes, so a plot draws in the theme's colors without a matching scale. A scale_*() added to the plot still takes precedence.

Examples

library(ggplot2)

p <- ggplot(mtcars) +
  geom_point(aes(x = wt, y = mpg, colour = factor(gear)))

# Light version with different main accent colors
for (accent in ggthemes::ggthemes_data[["solarized"]][["Accents"]][["name"]]) {
  print(p + theme_solarized() + scale_colour_solarized(accent))
}









# Dark version
p + theme_solarized(light = FALSE) + scale_colour_solarized("blue")


# Alternative theme
p + theme_solarized_2(light = FALSE) + scale_colour_solarized("blue")