[R-pkgs] ggplot2 - version 0.8

hadley wickham h.wickham at gmail.com
Fri Nov 21 13:53:31 CET 2008

ggplot2 ------------------------------------------------------------

ggplot2 is a plotting system for R, based on the grammar of graphics,
which tries to take the good parts of base and lattice graphics and
avoid bad parts. It takes care of many of the fiddly details
that make plotting a hassle (like drawing legends) as well as
providing a powerful model of graphics that makes it easy to produce
complex multi-layered graphics.

Find out more at http://had.co.nz/ggplot2, and check out the nearly 500
examples of ggplot in use.  If you're interested, you can also sign up to
the ggplot2 mailing list at http://groups.google.com/group/ggplot2, or track
development at  http://github.com/hadley/ggplot2

ggplot2 0.8  (2008-11-18)

The two biggest new features in this release are the (long awaited)
ability to have scales that vary between facets, and a faceting system
that works like lattice (facet_wrap). From qplot, you can use
facet_wrap by specifying one sided formula (~ colour, as opposed to .
~ color). To see some potential uses for these new features, see the
"Positioning" chapter of the book or the documentation for facet_wrap
and facet_grid.  Implementing these changes has required a rewrite of
large parts of the coordinate systems code, so if anything seems
strange with non-Cartesian coordinate systems, please get in touch.

I've also made another round of tweaks to make the plots more
aesthetically pleasing.  This includes using a bright blue colour for
geoms used to add statistical summaries to plots (contour, smooth, and
quantiles), and tweaking the default colour scheme for the continuous
colour scale.  Please let me know what you think.  Remember that most
of these options are controllable with the theming system - see the
book chapter "Polishing your plots for publication".

Accompanying this new release of the package is an updated and
expanded version of the book.  The content of the book is now largely
complete (~170 pages), and over the coming months I will be working on
make it polished and easy to understand.  See
http://had.co.nz/ggplot2/book.  I love to hear your feedback about the
book, but at this point please don't bother reporting minor typos, I
would much rather hear about what you want to do, but can't figure out
from the book.

Other new features:

* geom_bin2d/stat_bin2d & geom_hex/stat_binhex: for 2d square and
hexagon binning, particularly useful for alleviating overplotting in
* geom_freqpoly: draws frequency polygons (= stat_bin + geom_line)
* scale_position: both discrete and continuous gain a new formatter
argument to control the default formatting of the axis labels.  See
also the handy numeric formatters: dollar, comma and percent
* the xlim and ylim functions now produce discrete scales when
appropriate, and generate a reverse scale if the minimum is greater
than the maximum


* coord_map gains experimental axis labels
* facet_grid: new support for varying scales in rows and columns
* facet_wrap: new faceter which wraps a 1d ribbon of panels into 2d,
in a similar way to lattice
* geom_bin: gains a drop argument to control whether or not 0 count
bins should be removed
* geom_path and geom_line gain arrows argument to match geom_segment
* ggsave now checks that you are using it with a ggplot plot
* ggsave now produces postscript files that are suitable for embedding
in another document
* ggsave now recognises the .svg extension and will produce svg files,
if possible
* ggsave: default dpi changed to 300, on the assumption that you are
saving the plot for printing
* qplot: uses facet_wrap if formula looks like ~ a + b (as opposed to a ~ b)

Aesthetic tweaks

* geom_bar, geom_polygon, geom_rect, ...: default fill colour is now
much closer to black to match the defaults in other geoms (point,
line, etc)
* geom_line, geom_path, geom_segment: lines have squared ends
* geom_point, geom_pointrange and geom_boxplot: now use shape = 16
instead of 19.  This shape does not have a border from R 2.8 on, and
so will look better when displayed transparently.
* geom_contour, geom_density2d, geom_quantile and geom_smooth use a
bright blue colour for lines, to make them stand out when used with
black points
* scale_gradient: tweaked default colours to make more aesthetically pleasing
* theme: new theme setting panel.margin (a unit) controls gap between
panels in facetted plots (for both grid and wrap)
* theme_gray: removed black border around strips
* theme_bw: tweaks to make black and white theme look a little nicer

Bug fixes

* coord_cartesian now correctly clips instead of dropping points
outside of its limits
* facet_grid: margins now grouped correctly in default case
(non-aesthetic variables ignored when generating default group value)
* facet_grid: fix long standing bug when combining datasets with
different levels of facetting variable
* geom_smooth calls stat::predict explicitly to avoid conflicts with
packages that override predict for S4 model classes
* grid: correctly expose subcomponents of strips and axes
* mapping aesthetics to functions of stat output now works in a much
wider variety of cases
* order aesthetic should now work with bars (and in general more geoms)
* position_dodge now works with points and other geoms that lack xmin and xmax
* scale_area works once more
* scale_discrete_position: empty levels are no longer displayed by
default, if you want them, use breaks = levels(myfactor)
* scale_discrete_position: fixed bug when limits were set
* scale_discrete_position: more aesthetically pleasing expansion for a
wider ranges of plots (picks expansion based on whether or not geom
with width used, e.g. bars)
* scale_gradient*: axes are correctly labelled when a transformation is used
* scale_x_log10, scale_y_sqrt etc now correctly transform output from
statistics as well as raw data
* scale_z_* now removed because no longer used by anything
* stat_bin: correctly returns 0 when no observations in a bin (was
previously returning NA)
* stat_quantreg: deal with yet another new output format from quantreg
* stat_contour now has arguments to control the position of the
contours, rather than relying on the z scale
* theme: panel.empty setting removed as it is no longer used
* theme_grey now aliased to theme_gray
* theme_line: setting size works correctly
* theme_rect, theme_segment: size now measured in mm, to be consistent
with the rest of ggplot




More information about the R-packages mailing list