



















Aesthetics: Mapping Data to Visual Properties
Every plot in ggplot2
begins with aesthetic mappings: which variables you want to show, and how you want to represent them visually.
In this lesson, you’ll learn how to map data to position, color, size, shape, and more — and how these choices influence how your audience reads and interprets your plot.
For a quick overview of available aesthetics and usage examples, check out the aesthetics explorer widget at the end of the lesson!
💄 What Exactly Are Aesthetics?
In essence, an aesthetic is a link between a variable in your data and a visual feature of the plot. For example:
- the position of points along the axes,
- the fill color of bars, or
- the type or width of a line.
The important part? You’re not setting these properties manually — you define them by linking it to your data using the aes()
function. Once the mapping is in place, ggplot2
takes care of translating your data into the aesthetics of your choice.
That’s the magic of aesthetic mapping:
It’s always driven by data!
Let’s begin with the simplest type of mapping: specifying which columns define the positions along the axes. If you followed the previous lesson, this will feel familiar!
Drag and drop columns of the
🎨 Adding More Aesthetics
Let’s take it one step further. You can map additional aesthetics to make your plots more informative — for example, by linking the color, shape, or size of your points to variables in your dataset.
Oh no! 😱
It seems like you haven’t enrolled in the course yet!
Join many other students today and become the ggplot2 expert your company needs!
Or Login