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

The following example is intended to introduce you to the elements of different themes. The plot that we will produce at the end is not necessarily the best visual choice; it is primarily created to illustrate the options.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.66.13