scale_colour_cmocean | R Documentation |
Helper functions to allow the colour scale to be used effectively in ggplot2.
scale_colour_cmocean( ..., alpha = 1, start = 0, end = 1, direction = 1, discrete = FALSE, name = "thermal", version = getOption('cmocean-version', '2.0') ) scale_color_cmocean( ..., alpha = 1, start = 0, end = 1, direction = 1, discrete = FALSE, name = "thermal", version = getOption('cmocean-version', '2.0') ) scale_fill_cmocean( ..., alpha = 1, start = 0, end = 1, direction = 1, discrete = FALSE, name = "thermal", version = getOption('cmocean-version', '2.0') )
... |
parameters to ggplot2 functions |
alpha |
opacity of the palette in the range [0, 1]. |
start |
fraction of the colormap to clip from its start, in [0, 1]. |
end |
fraction of the colormap where it should stop, in [0, 1]; start < end. |
direction |
set to |
discrete |
set to |
name |
the name of one of the available cmocean colormaps, see
|
version |
specific |
A ggplot
object to be used with other ggplot
objects.
As requested by Ilja Kocken in https://github.com/aitap/cmocean/issues/5.
cmocean
if (require('ggplot2')) { dat <- data.frame( a = 1:10, b = 11:20, c = rnorm(10) ) ggplot(dat, aes(x = a, y = b, fill = c)) + geom_raster() + scale_fill_cmocean() }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.