Skip to contents

Plotting with PrettyCols palettes for fill colour ggplot2

Usage

scale_fill_pretty_div(name, direction = 1, legend_title = NULL, ...)

Arguments

name

Name of Palette. Run view_all_palettes(type = "div") to view options. Must be a diverging palette name.

direction

Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed

legend_title

Character string specifying legend title. Default NULL.

...

Other arguments passed on to scale_colour_gradient2

Value

A ggproto object defining a continuous colour scale for use with ggplot2.

Examples

library(ggplot2)
ggplot(data=mtcars, aes(x=mpg, y=disp, fill=wt)) +
  geom_point(pch = 21) +
  scale_fill_pretty_div("PurpleYellows", midpoint = mean(mtcars$wt))