Description Usage Arguments See Also Examples
Color scale constructor for FT colors
1 2 | scale_color_ft(palette = "main", discrete = TRUE, reverse = FALSE,
...)
|
palette |
Character name of a palette |
discrete |
Boolean indicating whether color aesthetic is discrete or not |
reverse |
Boolean indicating whether the palette should be reversed |
... |
Additional arguments passed to discrete_scale() or scale_color_gradientn() |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | df <- data.frame(
x = runif(50),
y = runif(50),
z = rnorm(50),
category = letters[1 + rbinom(50, 3, .25)]
)
library(ggplot2)
# plot with discrete color scale
ggplot(df) +
geom_point(aes(x, y, color = category)) +
scale_color_ft()
# plot with continuous color scale
ggplot(df) +
geom_point(aes(x, y, color = z)) +
scale_color_ft(palette = "claret", discrete = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.