0Pricing
R Academy · Lesson

Layers and Geoms

Add different layers to plots, including points, lines, bars, and more to build complex visualizations.

1

Introduction to Layers and Geoms in ggplot2

ggplot2 builds plots using layers. Each layer adds more information to the visualization.

Layers and Geoms — illustration 1

2

Understanding Layers

Each ggplot consists of multiple layers that define data, aesthetics, and geoms.

ggplot(mtcars, aes(x=mpg, y=hp)) + geom_point() + geom_smooth()

All lessons in this course

  1. ggplot2 Basics
  2. Layers and Geoms
  3. Theme Customization
← Back to R Academy