| ggplot2-scales | R Documentation |
These functions provide the option to use the scico palettes along with the
ggplot2 package. It goes without saying that it requires ggplot2 to work.
scale_colour_scico(
...,
alpha = NULL,
begin = 0,
end = 1,
direction = 1,
palette = "bilbao",
midpoint = NA
)
scale_color_scico(
...,
alpha = NULL,
begin = 0,
end = 1,
direction = 1,
palette = "bilbao",
midpoint = NA
)
scale_fill_scico(
...,
alpha = NULL,
begin = 0,
end = 1,
direction = 1,
palette = "bilbao",
midpoint = NA
)
scale_colour_scico_d(
...,
alpha = 1,
begin = 0,
end = 1,
direction = 1,
palette = "batlow",
aesthetics = "colour"
)
scale_color_scico_d(
...,
alpha = 1,
begin = 0,
end = 1,
direction = 1,
palette = "batlow",
aesthetics = "colour"
)
scale_fill_scico_d(
...,
alpha = 1,
begin = 0,
end = 1,
direction = 1,
palette = "batlow",
aesthetics = "fill"
)
... |
Arguments to pass on to |
alpha |
The opacity of the generated colours. If specified rgba values
will be generated. The default ( |
begin, end |
The interval within the palette to sample colours from.
Defaults to |
direction |
Either |
palette |
The name of the palette to sample from. See
|
midpoint |
A midpoint to center the scale on, used primarily for diverging and multisequential scales |
aesthetics |
Character string or vector of character strings listing the name(s) of the aesthetic(s) that this scale works with. This can be useful, for example, to apply colour settings to the colour and fill aesthetics at the same time, via aesthetics = c("colour", "fill"). |
A ScaleContinuous or ScaleDiscrete object that can be added to a
ggplot object
if (require('ggplot2')) {
volcano <- data.frame(
x = rep(seq_len(ncol(volcano)), each = nrow(volcano)),
y = rep(seq_len(nrow(volcano)), ncol(volcano)),
height = as.vector(volcano)
)
ggplot(volcano, aes(x = x, y = y, fill = height)) +
geom_raster() +
scale_fill_scico(palette = 'tokyo')
ggplot(iris, aes(x=Petal.Width, y=Petal.Length)) +
geom_point(aes(color=Species), size=10) +
scale_colour_scico_d()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.