diff --git a/NEWS b/NEWS index 80507fadc9..b5229514b8 100644 --- a/NEWS +++ b/NEWS @@ -1,27 +1,35 @@ -ggplot2 0.8.4 (2009-XX-XX) ----------------------------------------- +ggplot2 0.8.4 (2009-XX-XX) ---------------------------------------- * aes and aes_string both convert prefixes to full names -* aesthetics: corrected list of aesthetics to include american spelling of colour as well as base R abbreviations +* aesthetics: corrected list of aesthetics to include american spelling of + colour as well as base R abbreviations * aesthetics: fix bug in detecting which aesthetics are calculated * aes_string treats NULL as "NULL" * annotate now works with missing x and y (e.g. for geom_rect) * continuous scale limits now automatically sorted * coord_polar: fix bug if breaks not all inside limits * facet_wrap: can now specify both ncol and nrow without getting an error -* facet_wrap: now works with statistics that produce both x and y values (e.g. stat_qq) -* fullseq now adds additional break on bottom if necessary, so that the include.lowest argument in cut never comes into play (this the source of a potential bug in histograms) +* facet_wrap: now works with statistics that produce both x and y values (e.g. + stat_qq) +* fullseq now adds additional break on bottom if necessary, so that the + include.lowest argument in cut never comes into play (this the source of a + potential bug in histograms) * geom_boxplot: alpha now affects fill colour of boxes only -* geom_path correctly switches to segments if varying alpha used (thanks to Karl Ove Hufthammer for the report and Baptiste Auguie for the fix) +* geom_path correctly switches to segments if varying alpha used (thanks to + Karl Ove Hufthammer for the report and Baptiste Auguie for the fix) * geom_point: the alpha aesthetic now also affects the fill. -* geom_ribbon always sorts input to avoid problems with certain pathological inputs +* geom_ribbon always sorts input to avoid problems with certain pathological + inputs * geom_smooth was incorrectly applying alpha to line colour in the legend * nullGrob renamed to zeroGrob to avoid name conflict with grid * position_collide now works with missing values * position_stack: fixed bug in detection of overlap for negative values -* scale_discrete_position now uses drop argument to force dropping of unused levels -* scale_gradient now uses labels parameters, if supplied +* scale_discrete_position now uses drop argument to force dropping of unused + levels +* scale_gradient, scale_gradient2 and scale_gradientn now uses label + parameters, if supplied * scale_x_inverse, scale_y_inverse now actually work, and added recip as alias * stat_qq now correctly groups results -* stat_smooth will not try and fit a line to 2 or fewer points (previously didn't try for only 1 point) +* stat_smooth will not try and fit a line to 2 or fewer points (previously + didn't try for only 1 point) * stat_spoke now works with reversed scales diff --git a/R/scale-continuous-colour.r b/R/scale-continuous-colour.r index 5ac33598bf..354f6ae248 100644 --- a/R/scale-continuous-colour.r +++ b/R/scale-continuous-colour.r @@ -117,7 +117,9 @@ ScaleGradient2 <- proto(ScaleContinuous, expr={ desc <- "Smooth gradient between three colours (high, low and midpoints)" output_breaks <- function(.) .$map(.$input_breaks()) - labels <- function(.) .$.tr$label(.$input_breaks()) + labels <- function(.) { + nulldefault(.$.labels, .$.tr$label(.$input_breaks())) + } icon <- function(.) { g <- scale_fill_gradient2() @@ -215,7 +217,9 @@ ScaleGradientn <- proto(ScaleContinuous, expr={ desc <- "Smooth gradient between n colours" output_breaks <- function(.) .$map(.$input_breaks()) - labels <- function(.) .$.tr$label(.$input_breaks()) + labels <- function(.) { + nulldefault(.$.labels, .$.tr$label(.$input_breaks())) + } icon <- function(.) { g <- scale_fill_gradientn(colours = rainbow(7)) @@ -242,6 +246,10 @@ ScaleGradientn <- proto(ScaleContinuous, expr={ (d <- qplot(x, y, data=dsub, colour=diff)) d + scale_colour_gradientn(colour = rainbow(7)) + breaks <- c(-0.5, 0, 0.5) + d + scale_colour_gradientn(colour = rainbow(7), + breaks = breaks, labels = format(breaks)) + d + scale_colour_gradientn(colour = topo.colors(10)) d + scale_colour_gradientn(colour = terrain.colors(10))