Learn R Programming

paletteer (version 0.1.0)

ggplot2-scales-continuous: Continuous scales to use for ggplot2

Description

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

Usage

scale_colour_paletteer_c(package, palette, direction = 1, ...)

scale_color_paletteer_c(package, palette, direction = 1, ...)

scale_fill_paletteer_c(package, palette, direction = 1, ...)

Arguments

package

Name of package from which the palette is desired as string or symbol.

palette

Name of palette as string or symbol.

direction

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

...

Arguments to pass on to ggplot2::scale_colour_gradientn() or ggplot2::scale_fill_gradientn()

Value

A ScaleContinuous object that can be added to a ggplot object

Details

Available package/palette combinations are available in the data.frame palettes_c_names. Both package and palette can be supplied as symbols or strings.

Examples

Run this code
# NOT RUN {
if (require('ggplot2')) {

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

# }

Run the code above in your browser using DataLab