Skip to contents

Changes default theme and color scales for ggplot2.

Usage

set_ggplot_opts(base_theme = NULL, brewer_pal_discrete = "Set1", ...)

Details

Theme is based on hrbrthemes::theme_ipsum_rc(), unless otherwise specified in base_theme argument. The theme is further modified as follows:

  • Axis titles are centered

  • Legend title is omitted

  • Minor gridlines are omitted

  • Facet labels are placed outside axes

  • Various tweaks to text size and margins

Default color and fill palettes are set based on scale type:

  • For discrete scales, RColorBrewer palette "Set1," unless otherwise specified in brewer_pal_discrete argument

  • For continuous and binned scales, RColorBrewer palette "Blues"

  • For ordinal scales, viridisLite palette "viridis"

Default font family for geom_text() and geom_label() is set to match base_theme.