Design with Colorblind in Mind; Facets
November 4, 2024
Types of Colorblindness
Roughly 8% of men and half a percent of women are colorblind.
There are several techniques to make visualization more colorblind-friendly:
shape
for scatterplots and linetype
for line chartsggthemes
packageggthemes
package provides various themes for ggplot2
visualization:
scale_color_colorblind()
, scale_color_tableau()
theme_economist()
, theme_wsj()
ggthemes::scale_color_colorblind()
color
in aes()
, we can use scale_color_*()
ggthemes::scale_color_tableau()
scale_color_tableau()
provides color palettes used in Tableau.ggplot
Themesggthemes::theme_economist()
theme_economist()
approximates the style of The Economist.ggplot
Themesggthemes::theme_wsj()
theme_wsj()
approximates the style of The Wall Street Journal.facet_wrap(~ VAR)
facet_wrap()
.facet_wrap(~ VAR)
with nrow
nrow
determines the number of rows to use when laying out the facets.facet_wrap(~ VAR)
with ncol
ncol
determines the number of columns to use when laying out the facets.facet_wrap(~ VAR)
with scales
scales = "free_x"
allow for different scales of x-axisfacet_wrap(~ VAR)
with scales
scales = "free_y"
allow for different scales of y-axisfacet_wrap(~ VAR)
with scales
scales = "free"
allow for different scales of both x-axis and y-axis