ggplot2 version 2 adds extensibility and other improvements

December 28, 2015
By

[This article was first published on Revolutions, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Despite the ggplot2 project — the most popular data visualization package for R — being in maintenance mode, RStudio's Hadley Wickham has given the R community a surprise gift with a version 2.0.0 update for ggplot2. According to Hadley this is a "huge" update with more than 100 fixes and improvements.

The most significant addition is that ggplot2 now has a formal extension mechanism, which means that package authors can now create their own geoms (plot types), statistics (data aggregation/transformation methods) and themes. There are also a number of smaller improvements, including making it easy to draw curved lines between points with geom_curve, a way to suppress overlapping text labels, and a way to add labels with rounded enclosing boxes to plots. There are also a few minor changes to the appearance of plots, with some changes to colors and text sizes to improve readability and (my personal favorite) the elimination of the diagonal line that used to appear in the color boxes in legends. 

No line legendsIf you're new to ggplot2, getting to grips with the Grammar of Graphics system can be a steep learning curve, but it's well worth it in terms of long-term productivity in creating beautiful graphics with R. Hadley Wickham's book, Elegant Graphics for Data Analysis, is a great place to get started. Experienced ggplot2 users will also appreciate the freshly-updated ggplot2 cheatsheet from the RStudio team.

This new update is mostly compatible with older versions of ggplot2, but it may require updates to existing code in some cases. (If you want to try the new ggplot2 but still have access to old versions for compatibility, take a look at the checkpoint package.) The updated ggplot2 package is now available for download via CRAN with install.packages("ggplot2"), or via the ggplot2 Github repository.

RStudio Blog: ggplot2 2.0.0

To leave a comment for the author, please follow the link and comment on their blog: Revolutions.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)