Themes

In ggplot2, you have access to a series of functions that enable detailed control of plot appearance. These functions are called themes in ggplot2 and can be used to control nondata components of plots, such as the axis font, plot background, and position of the legend. This means that they do not affect how the data is represented in terms of geometry or how it is transformed by the scales. The main function in this respect is the theme() function. This function is very complex since it allows you to specify all the different details contributing to the plot appearance as well as generating your own format and style. In the next few pages, we will see some illustrative examples that demonstrate what you can produce, but for more details, ...

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.