The RColorBrewer package offers about 25 different
color palettes for R. To build a color palette using it, use the
brewer.pal() function.
Note: if you need more than 7 colors, read
this post.
Note: visit
this post for a complete
list of the available palettes.
# No marginpar(mar=c(0,0,1,0))# Load RColorBrewerlibrary(RColorBrewer)# Build a color palette, 5 colors coming from the BuPu color palette"coul <-brewer.pal(5, "BuPu") # Build a pie chart with itpie(rep(1, length(coul)), col = coul , main="")
Related chart types
Ggplot2
Animation
Interactivity
3D
Caveats
Data art
❤️ 10 best R tricks ❤️
👋 After crafting hundreds of R charts over 12 years, I've
distilled my top 10 tips and tricks. Receive them via email!
One insight per day for the next 10 days! 🔥