Graphics Reference
In-Depth Information
Figure 9-4. Aligning with hjust and vjust, and spacing with lineheight
Using Themes
Problem
You want to use premade themes to control the overall plot appearance.
Solution
To use a premade theme, add theme_bw() or theme_grey() ( Figure 9-5 ):
library(gcookbook) # For the data set
# Base plot
p <- ggplot(heightweight, aes(x = ageYear, y = heightIn)) + geom_point()
# Grey theme (the default)
p + theme_grey()
# Black-and-white theme
p + theme_bw()
Search WWH ::




Custom Search