Skip to content

Commit 8145089

Browse files
committed
More news tweaking
1 parent a3aa281 commit 8145089

File tree

1 file changed

+65
-74
lines changed

1 file changed

+65
-74
lines changed

NEWS.md

Lines changed: 65 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,40 @@
44

55
## Subtitle and caption
66

7-
Thanks to @hrbrmstr plots now have subtitles and captions. `ggtitle()` and `labs()` gain `subtitle` and `caption` parameters, and their display is controlled by theme settings `plot.caption` and `plot.subtitle`.
8-
9-
The main plot title is now left-aligned to better work better with a subtitle. The caption is right-aligned (@hrbrmstr)
7+
Thanks to @hrbrmstr plots now have subtitles and captions, which can be set with the `subtitle` and `caption` arguments to `ggtitle()` and `labs()`. You can control their appearance with the theme settings `plot.caption` and `plot.subtitle`. The main plot title is now left-aligned to better work better with a subtitle. The caption is right-aligned (@hrbrmstr).
108

119
### Stacking
1210

13-
`position_stack()` and `position_fill()` now sort the stacking order to match the order of grouping. This allows you to control the order through grouping, and ensures that the default legend matches the plot (#1552, #1593). If you want the opposite order (useful if you have horizontal bars and horizontal legend), you can request reverse stacking by using `position = position_stack(reverse = TRUE)` (#1837).
11+
`position_stack()` and `position_fill()` now sort the stacking order to match grouping order. This allows you to control the order through grouping, and ensures that the default legend matches the plot (#1552, #1593). If you want the opposite order (useful if you have horizontal bars and horizontal legend), you can request reverse stacking by using `position = position_stack(reverse = TRUE)` (#1837).
1412

15-
`position_stack()` now accepts negative values which will create stacks extending below the x-axis (#1691).
13+
`position_stack()` and `position_fill()` now accepts negative values which will create stacks extending below the x-axis (#1691).
14+
15+
`position_stack()` and `position_fill()` gain a `vjust` argument which makes it easy to (e.g.) display labels in the middle of stacked bars (#1821).
1616

17-
`position_stack()` gains a `vjust` argument which makes it easy to (e.g.) display labels in the middle of stacked bars (#1821).
17+
### Layers
1818

19-
### `geom_col()`
19+
`geom_col()` was added to complement `geom_bar()` (@hrbrmstr). It uses `stat="identity"` by default, making the `y` aesthetic mandatory. It does not support any other `stat_()` and does not provide fallback support for the `binwidth` parameter. Examples and references in other functions were updated to demonstrate `geom_col()` usage.
2020

21-
`geom_col()` was added to complement `geom_bar()`. It uses `stat="identity"` by default, making the `y` aesthetic mandatory. It does not support any other `stat_()` and does not provide fallback support for the `binwidth` parameter. Examples and references in other functions were updated to demonstrate `geom_col()` usage. (@hrbrmstr)
21+
When creating a layer, ggplot2 will warn if you use an unknown aesthetic or an unknown parameter. Compared to the previous version, this is stricter for aesthetics (previously there was no message), and less strict for parameters (previously this threw an error) (#1585).
2222

2323
### Facetting
2424

25-
The facet system, as well as the internal panel class, has been rewritten in ggproto. Facets are now extendable in the same manner as geoms, stats etc. and the manner in which this is done is described in the extension vignette.
25+
The facet system, as well as the internal panel class, has been rewritten in ggproto. Facets are now extendable in the same manner as geoms and stats, as described in `vignette("extending-ggplot2")`.
2626

27-
On top of that the rewrite has added the following:
27+
We have also added the following new fatures.
2828

29-
* `facet_grid` and `facet_wrap` now allow the use of expressions in their
30-
facetting formulas (fixes #1596). Thanks to @DanRuderman.
29+
* `facet_grid()` and `facet_wrap()` now allow expressions in their facetting
30+
formulas (@DanRuderman, #1596).
3131

32-
* When `facet_wrap` results in an uneven number of panels, axes will now be
32+
* When `facet_wrap()` results in an uneven number of panels, axes will now be
3333
drawn underneath the hanging panels (fixes #1607)
3434

35-
* strips can now be freely positioned in `facet_wrap` using the
35+
* Strips can now be freely positioned in `facet_wrap()` using the
3636
`strip.position` argument (deprecates `switch`).
3737

3838
* The relative order of panel, strip, and axis can now be controlled with
39-
the theme setting `strip.placement` that takes either `inside` (between
40-
panel and axis) or `outside` (after axis).
39+
the theme setting `strip.placement` that takes either `inside` (strip between
40+
panel and axis) or `outside` (strip after axis).
4141

4242
* The theme option `panel.margin` has been deprecated in favour of
4343
`panel.spacing` to more clearly communicate intent.
@@ -46,36 +46,36 @@ On top of that the rewrite has added the following:
4646

4747
* The position of x and y axes can now be changed using the `position` argument
4848
in `scale_x_*`and `scale_y_*` which can take `top` and `bottom`, and `left`
49-
and `right` respectively. The styling of top and right axes text and labels
50-
can be modified specifically using the `.top` and `.right` modifiers to
51-
`axis.text.*` and `axis.title.*`.
49+
and `right` respectively. The themes of top and right axes can be modified
50+
using the `.top` and `.right` modifiers to `axis.text.*` and `axis.title.*`.
5251

5352
### Continuous scales
5453

5554
* `scale_x_continuous()` and `scale_y_continuous()` can now display a secondary
56-
axis that is a one-to-one transformation of the primary axis (e.g. degrees
55+
axis that is a __one-to-one__ transformation of the primary axis (e.g. degrees
5756
Celcius to degrees Fahrenheit). The secondary axis will be positioned opposite
58-
to the primary axis and can be controlled using the `sec.axis` argument to
57+
to the primary axis and can be controlled with the `sec.axis` argument to
5958
the scale constructor.
6059

6160
* Scales worry less about having breaks. If no breaks can be computed, the
6261
plot will work instead of throwing an uninformative error (#791). This
63-
is helpful
62+
is particularly helpful when you have facets with free scales, and not
63+
all panels contain data.
6464

65-
* A warning is now issued when a scale transformation introduces infinite
66-
values in a scale (#1696)
65+
* Scales now warn when transformation introduces infinite values (#1696).
6766

6867
### Date time
6968

70-
* `scale_*_datetime()` now supports timezones. The timezone recorded on
71-
your data will be used by default, but can be overridden with the `timezone`
72-
argument.
69+
* `scale_*_datetime()` now supports time zones. It will use the timezone
70+
attached to the varaible by default, but can be overridden with the
71+
`timezone` argument.
7372

74-
* New `scale_x_time()` and `scale_y_time()` for hms vectors (#1752).
73+
* New `scale_x_time()` and `scale_y_time()` generate reasonable default
74+
breaks and labels for hms vectors (#1752).
7575

7676
### Discrete scales
7777

78-
The treatment of missing values by discrete scales has been thoroughly overhauled (#1584). The underlying principle is that we can naturally represent missing values on discrete variables (by treating just like another level), so by default we should.
78+
The treatment of missing values by discrete scales has been thoroughly overhauled (#1584). The underlying principle is that we can naturally represent missing values on discrete variables (by treating just like another level), so by default we should.
7979

8080
This principle applies to:
8181

@@ -85,92 +85,84 @@ This principle applies to:
8585

8686
And to all scales (both position and non-position.)
8787

88-
Compared to the previous version of ggplot2, that means there are 3 main
89-
changes:
88+
Compared to the previous version of ggplot2, there are three main changes:
9089

91-
* `scale_x_discrete()` and `scale_y_discrete()` always show discrete NA,
92-
regardless of their source
90+
1. `scale_x_discrete()` and `scale_y_discrete()` always show discrete NA,
91+
regardless of their source
9392

94-
* If present, `NA`s are shown in discete legends.
93+
1. If present, `NA`s are shown in discete legends.
9594

96-
* All discrete scales gain a `na.translate` argument that allows you to
97-
control whether `NA`s are translated to something that can be visualised
98-
or left as missing. Note that if you leave as is (i.e.
99-
`na.translate = FALSE)` they will passed on to the layer, which
100-
will create warnings about dropping missing values. To suppress those,
101-
you'll also need to add `na.rm = TRUE` to the layer call.
95+
1. All discrete scales gain a `na.translate` argument that allows you to
96+
control whether `NA`s are translated to something that can be visualised,
97+
or should be left as missing. Note that if you don't translate (i.e.
98+
`na.translate = FALSE)` the missing values will passed on to the layer,
99+
which will warning that it's dropping missing values. To suppress the
100+
warnings, you'll also need to add `na.rm = TRUE` to the layer call.
102101

103102
There were also a number of other smaller changes
104103

105-
* should now work better with unicode labels on Windows (#1827).
106-
* only issue one warning is issued when asking for too many levels (#1674).
107-
* no longer preserve space for dropped levels (#1638).
108-
* correctly use scale expansion factors.
109-
* warn when used with only continuous data (#1589)
104+
* Correctly use scale expansion factors.
105+
* Don't preserve space for dropped levels (#1638).
106+
* Only issue one warning when when asking for too many levels (#1674).
107+
* Unicode labels work better on Windows (#1827).
108+
* Warn when used with only continuous data (#1589)
110109

111110
## Themes
112111

113-
* The `theme()` constructor now has named arguments rather than ellipsis. This
114-
should make autocomplete substantially more useful. The documentation has
115-
been considerably improved.
112+
* The `theme()` constructor now has named arguments rather than ellipses. This
113+
should make autocomplete substantially more useful. The documentation
114+
(including exampes) has been considerably improved.
116115

117116
* Built-in themes are more visually homogeneous, and match `theme_grey` better.
118117
(@jiho, #1679)
119118

120-
* When computing the height of titles ggplot2, now inclues the height of the
121-
descenders (i.e. the bits `g` and `y` that hang underneath). This makes
119+
* When computing the height of titles, ggplot2 now includes the height of the
120+
descenders (i.e. the bits of `g` and `y` that hang beneath the baseline). This
122121
improves the margins around titles, particularly the y axis label (#1712).
123122
I have also very slightly increased the inner margins of axis titles, and
124123
removed the outer margins.
125124

126-
* Theme element inheritance is now easier to work with. Modification now
125+
* Theme element inheritance is now easier to work with as modification now
127126
overrides default `element_blank` elements (#1555, #1557, #1565, #1567)
128127

129128
* Horizontal legends (i.e. legends on the top or bottom) are horizontally
130-
aligned by default (#1842). Use `legend.box = "vertical"` to override the
131-
default.
129+
aligned by default (#1842). Use `legend.box = "vertical"` to switch back
130+
to the previous behaviour.
132131

133132
* `element_line()` now takes an `arrow` argument to specify arrows at the end of
134133
lines (#1740)
135134

136-
There were a number of tweaks legend themes:
135+
There were a number of tweaks to the theme elements that control legends:
137136

138-
* `legend.justification` now works outside of plotting area as well.
139-
For example, you can use `theme(legend.justification = "top")` to make
140-
the legend align with the top of the plot.
137+
* `legend.justification` now controls appearance will plotting the legend
138+
outside of the plot area. For example, you can use
139+
`theme(legend.justification = "top")` to make the legend align with the
140+
top of the plot.
141141

142142
* `panel.margin` and `legend.margin` have been renamed to `panel.spacing` and
143-
`legend.spacing` respectively to better communicate intent (they only
143+
`legend.spacing` respectively, to better communicate intent (they only
144144
affect spacing between legends and panels, not the margins around them)
145145

146146
* `legend.margin` now controls margin around individual legends.
147147

148-
* New `legend.box.margin` controls the margin around the legend box.
149-
150-
* New `legend.box.background` controls the background of the legend box.
151-
152-
* New `legend.box.spacing` controls the distance between the plot area
153-
and the legend area
148+
* New `legend.box.background`, `legend.box.spacing`, and `legend.box.margin`
149+
control the background, spacing, and margin of the legend box (the region
150+
that contains all legends).
154151

155152
## Bug fixes and minor improvements
156153

157154
* ggplot2 now imports tibble. This ensures that all built-in datasets print
158155
compactly even if you haven't explicitly loaded tibble or dplyr (#1677).
159156

160-
* Class of aesthetic mapping is preserved when adding `aes()` objects. (#1624)
161-
162-
* When creating a layer, ggplot2 will warn if you use an unknown aesthetic
163-
or an unknown parameter. Compared to the previous version, this is
164-
stricter for aesthetics (previously there was no message), and less
165-
strict for parameters (previously this threw an error) (#1585).
157+
* Class of aesthetic mapping is preserved when adding `aes()` objects (#1624).
166158

167159
* `+.gg` now works for lists that include data frames.
168160

169161
* `annotation_x()` now works in the absense of global data (#1655)
170162

171-
* `geom_*(show.legend = FALSE)` now works for `guide_colorbar`
163+
* `geom_*(show.legend = FALSE)` now works for `guide_colorbar`.
172164

173-
* `geom_boxplot` gain new `outlier.alpha` (@jonathan-g) and
165+
* `geom_boxplot()` gains new `outlier.alpha` (@jonathan-g) and
174166
`outlier.fill` (@schloerke, #1787) parameters to control the alpha/fill of
175167
outlier points independently of the alpha of the boxes.
176168

@@ -206,7 +198,7 @@ There were a number of tweaks legend themes:
206198

207199
* `stat_bin()` and `stat_summary_hex()` now accept length 1 `binwidth` (#1610)
208200

209-
* `stat_density` gains new argument `n`, which is passed to underlying function
201+
* `stat_density()` gains new argument `n`, which is passed to underlying function
210202
`stats::density` ("number of equally spaced points at which the
211203
density is to be estimated"). (@hbuschme)
212204

@@ -221,7 +213,6 @@ There were a number of tweaks legend themes:
221213
aesthetics they accept: `xmin_final`, `xmax_final`, `xlower`,
222214
`xmiddle` and `xupper` are now valid `x` aesthetics.
223215

224-
225216
# ggplot2 2.1.0
226217

227218
## New features

0 commit comments

Comments
 (0)