Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Introduction to Data Visualization with ggplot2

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Plot base
plt_mpg_vs_fcyl_by_fam <- ggplot(mtcars, aes(___, ___, color = ___))

# Default points are shown for comparison
plt_mpg_vs_fcyl_by_fam + ___
Code bewerken en uitvoeren