Description Usage Arguments Value Author(s) Examples
This set of scales defines new fill scales for correlation matrix plot equivalent to the ones already defined by ggplot2.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | scale_colour_gradient2n(
...,
colours,
midpoint = 0,
limits = NULL,
space = "Lab",
values = NULL,
na.value = "grey50",
guide = "colourbar",
aesthetics = "colour",
colors = NULL
)
scale_color_gradient2n(
...,
colours,
midpoint = 0,
limits = NULL,
space = "Lab",
values = NULL,
na.value = "grey50",
guide = "colourbar",
aesthetics = "colour",
colors = NULL
)
scale_fill_gradient2n(
...,
colours,
midpoint = 0,
limits = NULL,
space = "Lab",
values = NULL,
na.value = "grey50",
guide = "colourbar",
aesthetics = "fill",
colors = NULL
)
|
... |
Arguments passed on to
|
colours, colors |
vector of colours to use for n-colour gradient. |
midpoint |
The midpoint (in data value) of the diverging scale. Defaults to 0. |
limits |
a numeric vector of length two providing limits of the scale. |
space |
colour space in which to calculate gradient. Must be "Lab" - other values are deprecated. |
values |
if colours should not be evenly positioned along the gradient
this vector gives the position (between 0 and 1) for each colour in the
|
na.value |
Colour to use for missing values |
guide |
Type of legend. Use |
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 |
A ggproto object inheriting from 'Scale'
Houyun Huang, Lei Zhou, Jian Chen, Taiyun Wei
1 2 3 4 5 6 7 8 9 10 11 | df <- data.frame(x = rep(1:10, 10),
y = rep(1:10, each = 10),
z = runif(100, -1, 1))
library(ggplot2)
ggplot(df, aes(x, y, fill = z)) +
geom_tile() +
scale_fill_gradient2n()
ggplot(df, aes(x, y, colour = z)) +
geom_point(size = 4) +
scale_colour_gradient2n()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.