In spite of earlier announcements, Hadley continues to move ggplot2 forward, read more here:
http://blog.rstudio.org/2015/12/21/ggplot2-2-0-0/
Since I´ve done my last 20 papers or so with ggplot, I immediately adopted the latest version for papers in preparation and noted slight differences in my graphs. After a little hunting I solved the problems, this might speed up your own search:
- Using «coord_cartesian()» to prescribe exact axis limits now requires an additional parameter “expand = FALSE” which defaults to true.
- Tweaking axis label positions with “vjust” was a hack anyway, as Hadley says. Now achieved more cleanly with the margin property of the text element like in this example [placing labels at extremes, more space between axes & labels]:
… + theme(axis.title.y = element_text(hjust = 1, margin = margin(r = 7)), axis.title.x = element_text(hjust = 1, margin = margin(t = 7)))
Let ggplot rock on, enjoy!