scgradient: Scale: colour gradient Scale a continuous variable along a...

Description Usage Arguments Examples

View source: R/scale-continuous.r

Description

This scale creates a continuous colour gradient from the low colour to the mid colour to high colour, as defined in the arguments.

Usage

1
2
3
4
5
scgradient(plot, name = "", low = "red", mid = "white",
  high = "black", midpoint = 0, range = c(NA, NA))

scfillgradient(plot, name = "", low = "red", mid = "white",
  high = "black", midpoint = 0, range = c(NA, NA))

Arguments

plot

plot

name

namen of the scale (used in the legend)

low

colour at low end of scale

mid

colour at middle of scale

high

colour at top of scale

midpoint

definition of midpoint

range

range to scale data to

Examples

1
2
3
4
5
6
7
p <- scgradient(ggplot(reshape::tips, aes = list(x = sex, y = day)))
ggjitter(p, list(colour = total_bill))
ggjitter(p, list(colour = tip))

p <- ggjitter(p, list(colour = tip))
scgradient(p, low="yellow")
scgradient(p, high="green", midpoint=5)

hadley/ggplot1 documentation built on Aug. 19, 2019, 2:42 p.m.