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
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()