R/scale.R
scale_continuous_cognigen.Rd
Continuous scale for color and fill aesthetics with a purple gradient
scale_continuous_cognigen(..., na.value = "grey50", guide = "colourbar")
Arguments passed on to ggplot2::continuous_scale
scale_name
The name of the scale that should be used for error messages associated with this scale.
name
The name of the scale. Used as the axis or legend title. If
waiver()
, the default, the name of the scale is taken from the first
mapping used for that aesthetic. If NULL
, the legend title will be
omitted.
Colour to use for missing values
Type of legend. Use "colourbar"
for continuous
colour bar, or "legend"
for discrete colour legend.
library(ggplot2)
df <- data.frame(
value = seq(1, 100),
x = runif(100),
y = runif(100),
z = rnorm(100)
)
# color
ggplot(df, aes(x = x, y = y)) +
geom_point(aes(color = z), pch = 19) +
scale_continuous_cognigen()
# fill
ggplot(df, aes(x = value, y = y)) +
geom_bar(aes(fill = z), stat = "identity") +
scale_continuous_cognigen()