Scatterplots
A scatterplot displays the relationship between two continuous variables. Scatterplots are one of the most common types of graphs—in fact, you’ve met scatterplots already in Visualization Basics.
In this tutorial, you’ll learn how to:
- Make new types of scatterplots with
geom_text()
andgeom_jitter()
- Add multiple layers of geoms to a plot
- Enhance scatterplots with
geom_smooth()
,geom_rug()
, andgeom_repel()
- Change the coordinate system of a plot
The tutorial is adapted from R for Data Science by Hadley Wickham and Garrett Grolemund, published by O’Reilly Media, Inc., 2016, ISBN: 9781491910399. You can purchase the book at shop.oreilly.com.
The tutorial uses the {ggplot2}, {ggrepel}, and {dplyr} packages, which have been pre-loaded for your convenience.