scale_color_iucn | R Documentation |
ggplot2 color scales using the colors for the IUCN Red List threat categories, as documented in this chart.
scale_color_iucn(...)
scale_fill_iucn(...)
scale_discrete_iucn(aesthetics, ...)
... |
Arguments passed on to ggplot2::discrete_scale (except for
|
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 color settings to the |
library(ggplot2)
categories <- c("NE", "DD", "LC", "NT", "VU", "EN", "CR", "RE", "EW", "EX")
df <- data.frame(
x = runif(1000, 0, 10), y = runif(1000, 0, 10),
color = sample(categories, 1000, TRUE), shape = 21
)
ggplot(df) +
geom_point(aes(x = x, y = y, fill = color), shape = 21) +
scale_fill_iucn(name = "IUCN Category") +
theme_classic()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.