View source: R/scale-continuous.r
scgradient | R Documentation |
This scale creates a continuous colour gradient from the low colour to the mid colour to high colour, as defined in the arguments.
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)
)
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 |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.