I’m planning to release ggplot2 2.2.0 in early November. In preparation, I’d like to announce that a release candidate is now available: version 22.214.171.12401. Please try it out, and file an issue on GitHub if you discover any problems. I hope we can find and fix any major issues before the official release.
Install the pre-release version with:
devtools::install_github("hadley/ggplot2")[/code] If you discover a major bug that breaks your plots, please file a minimal reprex , and then roll back to the released version with:
[code]install.packages("ggplot2")[/code] ggplot2 2.2.0 will be a relatively major release including:
Subtitles and captions.
A large rewrite of the facetting system.
Improved theme options.
Numerous bug fixes and minor improvements .
The majority of this work was carried out by Thomas Pederson , who I was lucky to have as my “ggplot2 intern” this summer. Make sure to check out other visualisation packages: ggraph , ggforce , and tweenr .
Subtitles and captions
Thanks to Bob Rudis , you can now add subtitles and captions:
[code]ggplot(mpg, aes(displ, hwy)) +
geom_point(aes(color = class)) +
geom_smooth(se = FALSE, method = "loess") +
title = "Fuel efficiency generally decreases with engine size",
subtitle = "Two seaters (sports cars) are an exception because of their light weight",
caption = "Data from fueleconomy.gov"
[/code] These are controlled by the theme settings plot.subtitle and plot.caption .
The plot title is now aligned to the left by default. To return to the previous centering, use theme(plot.title = element_text(hjust = 0.5)) .
The facet and layout implementation has been moved to ggproto and received a large rewrite and refactoring. This will allow others to create their own facetting systems, as descrbied in the Extending ggplot2 vignette. Along with the rewrite a number of features and improvements has been added, most notably:
Functions in facetting formulas, thanks to Dan Ruderman . [code]ggplot(diamonds, aes(carat, price)) +
geom_hex(bins = 20) +
Axes were dropped when the panels in facet_wrap() did not completely fill the rectangle. Now, an axis is drawn underneath the hanging panels: [code]ggplot(mpg, aes(displ, hwy)) +