Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ggplot2-scales-binned

Binned scales to use for ggplot2


Description

These functions provide the option to use binned palettes along with the ggplot2 package. It goes without saying that it requires ggplot2 to work.

Usage

scale_colour_paletteer_binned(palette, direction = 1, ...)

scale_color_paletteer_binned(palette, direction = 1, ...)

scale_fill_paletteer_binned(palette, direction = 1, ...)

Arguments

palette

Name of palette as a string. Must be on the form packagename::palettename.

direction

Either 1 or -1. If -1 the palette will be reversed.

...

Arguments to pass on to ggplot2::scale_colour_stepsn() or ggplot2::scale_fill_stepsn()

Details

Available package/palette combinations are available in the data.frame palettes_c_names.

Value

A ScaleContinuous object that can be added to a ggplot object

Examples

if (require('ggplot2')) {

  ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, colour = Petal.Length)) +
    geom_point() +
    scale_colour_paletteer_binned("scico::tokyo")
}

paletteer

Comprehensive Collection of Color Palettes

v1.3.0
GPL-3
Authors
See AUTHORS file.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.