IniziaInizia gratis

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.

Questo esercizio fa parte del corso

Introduction to Data Visualization with ggplot2

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

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

# Default points are shown for comparison
plt_mpg_vs_fcyl_by_fam + ___
Modifica ed esegui il codice