Skip to content

Commit 814d0d1

Browse files
committed
Fixes #2679
1 parent 97076f0 commit 814d0d1

File tree

2 files changed

+24
-19
lines changed

2 files changed

+24
-19
lines changed

NEWS.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1-
# ggplot2 2.2.1.9000
2-
To be released as 2.3.0
1+
# ggplot2 3.0.0.9000
2+
* `stat_contour()`, `stat_density2d()`, `stat_bin2d()`, `stat_binhex()` also
3+
now calculate normalized statistics including `nlevel`, `ndensity`, and
4+
`ncount`. (@bjreisman, #2679)
5+
6+
* `stat_density()` now includes the calculated statistic `nlevel`, an alias
7+
for `scaled`, to better match the syntax of `stat_bin()` (@bjreisman, #2679)
8+
9+
* `geom_hex()` now understands the `size` and `linetype` aesthetics
10+
(@mikmart, #2488).
11+
12+
* Data is no longer internally reordered when faceting. This makes it safer to
13+
feed data columns into `aes()` or into parameters of geoms or stats. However,
14+
doing so remains discouraged (@clauswilke).
15+
16+
17+
# ggplot2 3.0.0
318

419
## Breaking changes
520

@@ -18,10 +33,11 @@ To be released as 2.3.0
1833
constants (like `aes(x = 1)` or `aes(colour = "smoothed")`) are stored
1934
as is.
2035

21-
In this version of ggplot2, you need to describe a mapping in a string,
22-
use `quo_name()` (for shorter labels) or `quo_text()` (if you want
23-
everything). If you do need to extract the value of a variable instead use
24-
`rlang::eval_tidy()`. You may want to condition on
36+
In this version of ggplot2, if you need to describe a mapping in a string,
37+
use `quo_name()` (to generate single-line strings; longer expressions may
38+
be abbreviated) or `quo_text()` (to generate non-abbreviated strings that
39+
may span multiple lines). If you do need to extract the value of a variable
40+
instead use `rlang::eval_tidy()`. You may want to condition on
2541
`(packageVersion("ggplot2") <= "2.2.1")` so that your code can work with
2642
both released and development versions of ggplot2.
2743

@@ -157,17 +173,6 @@ To be released as 2.3.0
157173

158174
### Layers: geoms, stats, and position adjustments
159175

160-
* `stat_contour()`, `stat_density2d()`, `stat_bin2d()`, `stat_binhex()` now
161-
include a normalized version the `level`, `density`, and `count` parameters,
162-
named `nlevel`, `ndensity`, and `ncount`. This mirrors the use of `ndensity`
163-
in `stat_density()` and `ncount`/`ndensity` in `stat_bin()`. These stats
164-
should be useful for faceted 2D density plots and bin plots in cases where
165-
the distribution of density within a facet is more relevant than the absolute
166-
density or count across facets. (@bjreisman, #2680)
167-
168-
* `stat_density()` now includes the calculated statistic `nlevel`, an alias
169-
for `scaled`, to better match the syntax of `stat_bin` (@bjreisman, #2680)
170-
171176
* `geom_segment()` and `geom_curve()` have a new `arrow.fill` parameter which
172177
allows you to specify a separate fill colour for closed arrowheads
173178
(@hrbrmstr and @clauswilke, #2375).

R/stat-density.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
#' \item{count}{density * number of points - useful for stacked density
2222
#' plots}
2323
#' \item{scaled}{density estimate, scaled to maximum of 1}
24-
#' \item{ndensity}{alias for stat(scaled), to mirror the syntax of
25-
#' geom_bin}
24+
#' \item{ndensity}{alias for `stat(scaled)`, to mirror the syntax of
25+
#' `geom_bin()`}
2626
#' }
2727
#' @export
2828
#' @rdname geom_density

0 commit comments

Comments
 (0)