Part II - Putting theory into practice
2024-06-13
cols4all
and esquisse
to make thoughtful visualization choices.For a complete list of preset themes:
Important
theme_bw()
and theme_minimal
can remove a lot of unnecessary ink with one fell swoop.
Use theme_set(theme_bw())
outside your plot code to set the theme for a whole script or notebook.
theme()
function allows you to modify individual elements of a themetheme
options are vast. We’ll break it down.theme
theme( <part of the plot> = <element_*(element_options)>)
theme(line = element_line())
, etc.facet_wrap
facet_wrap
facet_grid
Important
Use judiciously!
geoms
geom_point, geom_line, geom_col, ...
aes
(aesthetics):
x
and y
for positioncolor
and fill
for color scalealpha
for opacitysize
for sizeSize is much worse than position for showing continuous data!
Size is much worse than position for showing continuous data!
Shape is less effective than color for differentiating categories!
Shape is less effective than color for differentiating categories!
cols4all
esquisse
is a ggplot2 extension for exploring data-viz pairings