You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: NEWS.md
+65-74Lines changed: 65 additions & 74 deletions
Original file line number
Diff line number
Diff line change
@@ -4,40 +4,40 @@
4
4
5
5
## Subtitle and caption
6
6
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).
10
8
11
9
### Stacking
12
10
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).
14
12
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).
16
16
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
18
18
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.
20
20
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).
22
22
23
23
### Facetting
24
24
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 geomsand stats, as described in `vignette("extending-ggplot2")`.
26
26
27
-
On top of that the rewrite has added the following:
27
+
We have also added the following new fatures.
28
28
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).
31
31
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
33
33
drawn underneath the hanging panels (fixes #1607)
34
34
35
-
*strips can now be freely positioned in `facet_wrap` using the
35
+
*Strips can now be freely positioned in `facet_wrap()` using the
36
36
`strip.position` argument (deprecates `switch`).
37
37
38
38
* 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).
41
41
42
42
* The theme option `panel.margin` has been deprecated in favour of
43
43
`panel.spacing` to more clearly communicate intent.
@@ -46,36 +46,36 @@ On top of that the rewrite has added the following:
46
46
47
47
* The position of x and y axes can now be changed using the `position` argument
48
48
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.*`.
52
51
53
52
### Continuous scales
54
53
55
54
*`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
57
56
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
59
58
the scale constructor.
60
59
61
60
* Scales worry less about having breaks. If no breaks can be computed, the
62
61
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.
64
64
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).
67
66
68
67
### Date time
69
68
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.
73
72
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).
75
75
76
76
### Discrete scales
77
77
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.
79
79
80
80
This principle applies to:
81
81
@@ -85,92 +85,84 @@ This principle applies to:
85
85
86
86
And to all scales (both position and non-position.)
87
87
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:
90
89
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
93
92
94
-
* If present, `NA`s are shown in discete legends.
93
+
1. If present, `NA`s are shown in discete legends.
95
94
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.
102
101
103
102
There were also a number of other smaller changes
104
103
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)
110
109
111
110
## Themes
112
111
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.
116
115
117
116
* Built-in themes are more visually homogeneous, and match `theme_grey` better.
118
117
(@jiho, #1679)
119
118
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
122
121
improves the margins around titles, particularly the y axis label (#1712).
123
122
I have also very slightly increased the inner margins of axis titles, and
124
123
removed the outer margins.
125
124
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
127
126
overrides default `element_blank` elements (#1555, #1557, #1565, #1567)
128
127
129
128
* 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.
132
131
133
132
*`element_line()` now takes an `arrow` argument to specify arrows at the end of
134
133
lines (#1740)
135
134
136
-
There were a number of tweaks legend themes:
135
+
There were a number of tweaks to the theme elements that control legends:
137
136
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.
141
141
142
142
*`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
144
144
affect spacing between legends and panels, not the margins around them)
145
145
146
146
*`legend.margin` now controls margin around individual legends.
147
147
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).
154
151
155
152
## Bug fixes and minor improvements
156
153
157
154
* ggplot2 now imports tibble. This ensures that all built-in datasets print
158
155
compactly even if you haven't explicitly loaded tibble or dplyr (#1677).
159
156
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).
166
158
167
159
*`+.gg` now works for lists that include data frames.
168
160
169
161
*`annotation_x()` now works in the absense of global data (#1655)
170
162
171
-
*`geom_*(show.legend = FALSE)` now works for `guide_colorbar`
163
+
*`geom_*(show.legend = FALSE)` now works for `guide_colorbar`.
172
164
173
-
*`geom_boxplot` gain new `outlier.alpha` (@jonathan-g) and
165
+
*`geom_boxplot()` gains new `outlier.alpha` (@jonathan-g) and
174
166
`outlier.fill` (@schloerke, #1787) parameters to control the alpha/fill of
175
167
outlier points independently of the alpha of the boxes.
176
168
@@ -206,7 +198,7 @@ There were a number of tweaks legend themes:
206
198
207
199
*`stat_bin()` and `stat_summary_hex()` now accept length 1 `binwidth` (#1610)
208
200
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
210
202
`stats::density` ("number of equally spaced points at which the
211
203
density is to be estimated"). (@hbuschme)
212
204
@@ -221,7 +213,6 @@ There were a number of tweaks legend themes:
221
213
aesthetics they accept: `xmin_final`, `xmax_final`, `xlower`,
222
214
`xmiddle` and `xupper` are now valid `x` aesthetics.
0 commit comments