O'Reilly logo

ggplot2 Essentials by Donato Teutonico

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Faceting

Faceting is a mechanism to automatically lay out multiple plots on one page. This functionality is quite nice and useful in many situations and, for this reason, we will venture a little deeper into it and look at some examples. As already mentioned, if you are familiar with other plotting packages, this functionality is very similar to the concept of panels in lattice.

The plot is realized with the faceting option by splitting the data into subsets, and each subset of data is represented in an individual plot. Nevertheless, the individual plots are formatted in an overall plot page with a header at the top or on the side of the panels, which identify the data represented in the subplot. Faceting is particularly useful if you need to have ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required