Working with Colors
11:30-12:30
View slides in full screen | Run the code yourself
Outline
- Color Palettes
- Pre-Defined Color Palettes: Viridis
- Pre-Defined Color Palettes: Brewer
- {rcartocolor}
- {scico}
- {ggsci} and {ggthemes}
- {nord}
- {MetBrewer}
- Customize Palettes
- Customize Existing Palettes
- Create New Palettes
- Create Sequential Palettes
- Create Diverging Palettes
- Create Any Palette
- HCL Spectrum
- Evaluate HCL Spectrum
- Test Your Palettes
- Emulate CVD
Recap
- use categorical palettes for qualitative data
- e.g.
scale_*_discrete()andscale_*_manual()for custom options - e.g.
scale_*_viridis_dandscale_*_brewer()for pre-defined options
- e.g.
- use sequential or diverging palettes for quantitative data
- e.g.
scale_*_gradient()orscale_*_gradient2()for custom options - e.g.
scale_*_viridis_candscale_*_distiller()for pre-defined options
- e.g.
- various packages provide palettes incl.
scale_*components- e.g.
{rcartocolors},{scico},{ggsci},{ggthemes},{nord}
- e.g.
- those and even more packages return palettes as vectors
- modify and supply them to
scale_*_manual()andscale_*_gradientn()
- modify and supply them to
- use
after_scaleto modify and recycle color scales
Exercise
- Open the script
exercises/06_colors_ex1.qmd(or the.rmd). - Create a similar visualization as the one in the folder
exercises/7-1-bikes-jitter
→ Solution