Description Usage Arguments Value Examples
This is the default colour scale for categorical variables for the nature palette. It does not generate colour-blind safe palettes. These are the palettes to choose from:
uyuni
okavango
lakelouise
provence
halong
vatnajokull
arashiyama
mountcook
benagil
bryce
jozi
main
Palette Colours inspired by:
https://medium.com/sketch-app-sources/10-color-palettes-from-the-natural-world-to-inspire-your-creative-streak-bc2fb73d161e
Palette made ffg blog post:
https://drsimonj.svbtle.com/creating-corporate-colour-palettes-for-ggplot2
1 2 | scale_colour_nature(palette = "main", discrete = TRUE,
reverse = FALSE, ...)
|
palette |
Character name of palette in nature_palettes |
discrete |
Boolean indicating whether colour aesthetic is discrete or not |
reverse |
Boolean indicating whether the palette should be reversed |
... |
Additional arguments passed to discrete_scale() or scale_color_gradientn(), used respectively when discrete is TRUE or FALSE |
Colour scale of natural palette
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Colour using the `okavango` palette
library(ggplot2)
ggplot(mtcars, aes(hp, mpg, colour = cyl)) +
geom_point(size = 4, alpha = .8) +
scale_colour_nature(
discrete = FALSE,
palette = "uyuni",
guide = "none"
) +
facet_wrap(~cyl) +
theme_dark()
# Colour using the `halong` palette, and where cyl is discrete
library(ggplot2)
ggplot(mtcars, aes(hp, mpg, colour = as.factor(cyl))) +
geom_point(size = 4, alpha = .8) +
scale_colour_nature(
discrete = TRUE,
palette = "halong",
guide = "none"
) +
facet_wrap(~cyl)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.