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: vignettes/releases/ggplot2-2.2.0.Rmd
+76-62Lines changed: 76 additions & 62 deletions
Original file line number
Diff line number
Diff line change
@@ -21,37 +21,30 @@ knitr::opts_chunk$set(
21
21
fig.retina = NULL
22
22
)
23
23
```
24
+
<metacharset="utf-8">
24
25
25
-
I'm planning to release ggplot2 2.2.0 in early November. In preparation, I'd like to announce that a release candidate is now available: version 2.1.0.9001. Please try it out, and file an [issue on GitHub](https://github.com/tidyverse/ggplot2/issues) if you discover any problems. I hope we can find and fix any major issues before the official release.
26
+
I'm very pleased to announce ggplot2 2.2.0. It includes four major new features:
26
27
27
-
Install the pre-release version with:
28
+
* Subtitles and captions.
29
+
* A large rewrite of the facetting system.
30
+
* Improved theme options.
31
+
* Better stacking.
28
32
29
-
```{r, eval = FALSE}
30
-
# install.packages("devtools")
31
-
devtools::install_github("tidyverse/ggplot2")
32
-
```
33
+
It also includes as numerous bug fixes and minor improvements, as described in the [release notes](http://github.com/hadley/ggplot2/releases/tag/v2.2.0).
34
+
35
+
The majority of this work was carried out by [Thomas Pederson](https://github.com/thomasp85), who I was lucky to have as my "ggplot2 intern" this summer. Make sure to check out his other visualisation packages: [ggraph](https://github.com/thomasp85/ggraph), [ggforce](https://github.com/thomasp85/ggforce), and [tweenr](https://github.com/thomasp85/tweenr).
33
36
34
-
If you discover a major bug that breaks your plots, please [file a minimal reprex](https://github.com/tidyverse/ggplot2/issues), and then roll back to the released version with:
37
+
Install ggplot2with:
35
38
36
39
```{r, eval = FALSE}
37
40
install.packages("ggplot2")
38
41
```
39
42
40
-
ggplot2 2.2.0 will be a relatively major release including:
41
-
42
-
* Subtitles and captions.
43
-
* A large rewrite of the facetting system.
44
-
* Improved theme options.
45
-
* Better stacking
46
-
*[Numerous bug fixes and minor improvements][news.md].
47
-
48
-
The majority of this work was carried out by [Thomas Pederson](https://github.com/thomasp85), who I was lucky to have as my "ggplot2 intern" this summer. Make sure to check out other visualisation packages: [ggraph](https://github.com/thomasp85/ggraph), [ggforce](https://github.com/thomasp85/ggforce), and [tweenr](https://github.com/thomasp85/tweenr).
49
-
50
43
## Subtitles and captions
51
44
52
-
Thanks to [Bob Rudis](https://rud.is), you can now add subtitles and captions:
45
+
Thanks to [Bob Rudis](https://rud.is), you can now add subtitles and captions to your plots:
These are controlled by the theme settings `plot.subtitle` and `plot.caption`.
66
59
67
-
The plot title is now aligned to the left by default. To return to the previous centering, use `theme(plot.title = element_text(hjust = 0.5))`.
60
+
The plot title is now aligned to the left by default. To return to the previous centered alignment, use `theme(plot.title = element_text(hjust = 0.5))`.
68
61
69
62
## Facets
70
63
71
-
The facet and layout implementation has been moved to ggproto and received a large rewrite and refactoring. This will allow others to create their own facetting systems, as descrbied in the *Extending ggplot2*vignette. Along with the rewrite a number of features and improvements has been added, most notably:
72
-
73
-
* Functions in facetting formulas, thanks to
64
+
The facet and layout implementation has been moved to ggproto and received a large rewrite and refactoring. This will allow others to create their own facetting systems, as descrbied in the `vignette("extending-ggplot2")`. Along with the rewrite a number of features and improvements has been added, most notably:
65
+
66
+
* ou can now use functions in facetting formulas, thanks to
74
67
[Dan Ruderman](https://github.com/DanRuderman).
75
-
76
-
```{r}
68
+
69
+
```{r facet-1}
77
70
ggplot(diamonds, aes(carat, price)) +
78
71
geom_hex(bins = 20) +
79
72
facet_wrap(~cut_number(depth, 6))
80
73
```
81
74
82
-
* Axes were dropped when the panels in `facet_wrap()` did not completely
83
-
fill the rectangle. Now, an axis is drawn underneath the hanging panels:
75
+
* Axes are now drawn under the panels in `facet_wrap()` when the
76
+
rentangle is not completely filled.
84
77
85
-
```{r}
78
+
```{r facet-2}
86
79
ggplot(mpg, aes(displ, hwy)) +
87
80
geom_point() +
88
81
facet_wrap(~class)
89
82
```
90
83
91
-
* It is now possible to set the position of the axes through the `position`
92
-
argument in the scale constructor:
93
-
94
-
```{r}
84
+
* You can set the position of the axes with the `position` argument.
85
+
86
+
```{r facet-3}
95
87
ggplot(mpg, aes(displ, hwy)) +
96
88
geom_point() +
97
89
scale_x_continuous(position = "top") +
98
90
scale_y_continuous(position = "right")
99
91
```
100
92
101
-
* You can display a secondary axis that is a one-to-one transformation of the
102
-
primary axis with the `sec.axis` argument:
103
-
104
-
```{r}
93
+
* You can display a secondary axis that is a one-to-one transformation of
94
+
the primary axis with `sec.axis`.
95
+
96
+
```{r facet-4}
105
97
ggplot(mpg, aes(displ, hwy)) +
106
98
geom_point() +
107
99
scale_y_continuous(
@@ -110,10 +102,10 @@ The facet and layout implementation has been moved to ggproto and received a lar
110
102
)
111
103
```
112
104
113
-
* Strips can be placed on any side, and the placement with respect to axes
114
-
can be controlled with the `strip.placement` theme option.
115
-
116
-
```{r}
105
+
* Strips can be placed on any side, and the placement with respect to axes
106
+
can be controlled with the `strip.placement` theme option.
107
+
108
+
```{r facet-5}
117
109
ggplot(mpg, aes(displ, hwy)) +
118
110
geom_point() +
119
111
facet_wrap(~ drv, strip.position = "bottom") +
@@ -127,12 +119,15 @@ The facet and layout implementation has been moved to ggproto and received a lar
127
119
128
120
## Theming
129
121
122
+
* The `theme()` function now has named arguments so autocomplete
123
+
and documentation suggestions are vastly improved.
124
+
130
125
* Blank elements can now be overridden again so you get the expected
131
126
behavior when setting e.g. `axis.line.x`.
132
127
133
128
* `element_line()` gets an `arrow` argument that lets you put arrows on axes.
134
129
135
-
```{r}
130
+
```{r theme-1}
136
131
arrow <- arrow(length = unit(0.4, "cm"), type = "closed")
137
132
138
133
ggplot(mpg, aes(displ, hwy)) +
@@ -144,42 +139,40 @@ The facet and layout implementation has been moved to ggproto and received a lar
144
139
```
145
140
146
141
* Control of legend styling has been improved. The whole legend area can be
147
-
aligned according to the plot area and a box can be drawn around all legends:
142
+
aligned with the plot area and a box can be drawn around all legends:
0 commit comments