Skip to contents

The `mediocre` scales provide alternative default colors for ggplots. These functions enable to create such palettes. The main color palettes have been defined using https://coolors.co/.

Usage

scale_mediocre_d(pal = "autumn", second_pair = FALSE, gradient = NULL, ...)

scale_mediocre_c(pal = "autumn", gradient = NULL, ...)

Arguments

pal

a string. Defines the color palette selected. Can either be either "autumn", "rainbow", "green", "hotcold", "blackandwhite", "coty", "leo", "portal" or "pem"

second_pair

if true sets an alternative pair of colors for graphs with two colors

gradient

a string, either "left" or "right". Turns divergent palettes into gradient ones by splitting it in two. If equal to "right", the gradient palette is built with the right hand side part of the divergent palette. If equal to "left", uses the left hand side but flipping so that light values are on the left.

...

Other arguments passed on to discrete_scale, continuous_scale, or binned_scale to control name, limits, breaks, labels and so forth.

See also

Other color scales: palette_mediocre_d()

Examples

ggplot(ggplot2::mpg, aes(x = cty, y = displ, fill = manufacturer)) +
  geom_col() +
  theme_mediocre() +
  scale_mediocre_d()


ggplot(ggplot2::mpg, aes(x = cty, y = displ, color = hwy)) +
  geom_point() +
  theme_mediocre() +
  scale_mediocre_c()