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, you should definitely have a look at the document page at http://docs.ggplot2.org/current/theme.html.
In ggplot2
, you have two built-in themes available that can be applied directly to your plot: theme_grey()
, which is the default theme, has a gray...