my_palette | R Documentation |
A few of my favorite and most used (discrete) palettes. Some are just base R colors put into a vector. Others come from the following sources: https://github.com/mwaskom/seaborn/blob/master/seaborn/palettes.py https://personal.sron.nl/~pault/
my_palette(name, type = c("discrete", "continuous"))
name |
Name of desired palette. Choices are:
|
type |
Either "continuous" or "discrete". Use continuous if you want to automatically interpolate between colours. |
Adapted from [karthik/wesanderson](https://github.com/karthik/wesanderson) and [dill/beyonce](https://github.com/dill/beyonce)
A vector of colours.
library(tidyverse)
my_palette("tol_colors")
my_palette("tol_colors") %>%
view_palette()
ggplot(data = mtcars, aes(x = factor(cyl), fill = factor(vs))) +
geom_bar(stat = "count") +
scale_fill_manual(values = my_palette("tol_colors"))
ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
geom_point(size = 3) +
scale_color_manual(values = my_palette("lancet_colors")) +
theme_minimal()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.