Overplotting 2: Aligned values
Let's take a look at another case where we should be aware of overplotting: Aligning values on a single axis.
This occurs when one axis is continuous and the other is categorical, which can be overcome with some form of jittering.
In the mtcars
data set, fam
and fcyl
are categorical variants of cyl
and am
.
This exercise is part of the course
Introduction to Data Visualization with ggplot2
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Plot base
plt_mpg_vs_fcyl_by_fam <- ggplot(mtcars, aes(___, ___, color = ___))
# Default points are shown for comparison
plt_mpg_vs_fcyl_by_fam + ___