Chapter 3. The Layers and Grammar of Graphics

In this chapter, we will take a closer look at the grammar of graphics as implemented in ggplot2. We will go through the main concepts of the layer approach that will help you to understand and master the full potential of the basic qplot function which we were introduced to in Chapter 2, Getting Started. After a general introduction to the different components of the grammar of graphics, we will go deeper into the faceting, coordinate system, scales, and concept of layers in dedicated sections of this chapter. Afterwards, we will have a look at how you can use the ggplot() function and how its code relates to the one you have already seen used with the simplified qplot() function.

Components of layered ...

Get ggplot2 Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.