Themes and Changing the Appearance of Graphs

The Grammar of Graphics principle that underlies ggplot2 concerns how data is processed and displayed; it doesn't concern things such as fonts, background colors, and so on. To tune the appearances of these elements, ggplot2's theming system provides control over the appearance of non-data elements. In this book, we will touch upon a few thematic aspects. It will not be possible to go over all of the thematic options. For a more complete list of options, access the help guide by typing ?theme, or look at the ggplot2 manual.

Themes can be changed in multiple ways, as follows:

  • Changing them individually for each plot
  • Using a predefined theme
  • Defining your own theme and using it for all of your plots ...

Get Applied Data Visualization with R and ggplot2 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.