Pick the function depending on the aesthetic of your ggplot object (fill or color). On diverging palettes, a midpoint can be manually adjusted (defaults to 0). See cmap_gradients for a listing of available gradients.

cmap_fill_continuous(palette = "blues", reverse = FALSE, middle = 0, ...)

cmap_color_continuous(palette = "blues", reverse = FALSE, middle = 0, ...)

cmap_colour_continuous(palette = "blues", reverse = FALSE, middle = 0, ...)

Arguments

palette

String; Choose from 'cmap_gradients' list

reverse

Logical; Reverse color order?

middle

Numeric; Sets midpoint for diverging color palettes. Default = 0.

...

Additional parameters passed on to the scale type

Functions

  • cmap_fill_continuous(): for fill aesthetic

  • cmap_color_continuous(): for color aesthetic

  • cmap_colour_continuous(): for color aesthetic

Examples

ggplot(dplyr::filter(grp_over_time, cluster=="Biopharmaceuticals"),
       aes(x = year, y = realgrp, color = realgrp)) +
    geom_line() +
    cmap_color_continuous(palette = "red_purple")