Skip to content

Commit 62a5f4a

Browse files
authored
Merge branch 'main' into v3.4.3-rc
2 parents e89befc + 2cd0e96 commit 62a5f4a

File tree

322 files changed

+7718
-4431
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

322 files changed

+7718
-4431
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
cache-version: 3
6464
extra-packages: >
6565
any::rcmdcheck,
66-
Hmisc=?ignore-before-r=3.6.0,
66+
Hmisc=?ignore-before-r=4.1.0,
6767
quantreg=?ignore-before-r=3.6.0,
6868
needs: check
6969

DESCRIPTION

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ Suggests:
5252
hexbin,
5353
Hmisc,
5454
knitr,
55-
lattice,
5655
mapproj,
5756
maps,
5857
maptools,
@@ -63,7 +62,6 @@ Suggests:
6362
quantreg,
6463
ragg,
6564
RColorBrewer,
66-
rgeos,
6765
rmarkdown,
6866
rpart,
6967
sf (>= 0.7-3),
@@ -175,20 +173,22 @@ Collate:
175173
'grob-dotstack.R'
176174
'grob-null.R'
177175
'grouping.R'
176+
'guide-.R'
177+
'guide-axis.R'
178+
'guide-legend.R'
178179
'guide-bins.R'
179180
'guide-colorbar.R'
180181
'guide-colorsteps.R'
181-
'guide-legend.R'
182+
'layer.R'
183+
'guide-none.R'
184+
'guide-old.R'
182185
'guides-.R'
183-
'guides-axis.R'
184186
'guides-grid.R'
185-
'guides-none.R'
186187
'hexbin.R'
187188
'import-standalone-obj-type.R'
188189
'import-standalone-types-check.R'
189190
'labeller.R'
190191
'labels.R'
191-
'layer.R'
192192
'layer-sf.R'
193193
'layout.R'
194194
'limits.R'

NAMESPACE

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ S3method(ggplot_add,"NULL")
5555
S3method(ggplot_add,"function")
5656
S3method(ggplot_add,Coord)
5757
S3method(ggplot_add,Facet)
58+
S3method(ggplot_add,Guides)
5859
S3method(ggplot_add,Layer)
5960
S3method(ggplot_add,Scale)
6061
S3method(ggplot_add,by)
6162
S3method(ggplot_add,data.frame)
6263
S3method(ggplot_add,default)
63-
S3method(ggplot_add,guides)
6464
S3method(ggplot_add,labels)
6565
S3method(ggplot_add,list)
6666
S3method(ggplot_add,theme)
@@ -75,30 +75,11 @@ S3method(grobWidth,absoluteGrob)
7575
S3method(grobWidth,zeroGrob)
7676
S3method(grobX,absoluteGrob)
7777
S3method(grobY,absoluteGrob)
78-
S3method(guide_gengrob,axis)
79-
S3method(guide_gengrob,bins)
80-
S3method(guide_gengrob,colorbar)
81-
S3method(guide_gengrob,guide_none)
82-
S3method(guide_gengrob,legend)
83-
S3method(guide_geom,axis)
84-
S3method(guide_geom,bins)
85-
S3method(guide_geom,colorbar)
86-
S3method(guide_geom,guide_none)
87-
S3method(guide_geom,legend)
88-
S3method(guide_merge,axis)
89-
S3method(guide_merge,bins)
90-
S3method(guide_merge,colorbar)
91-
S3method(guide_merge,guide_none)
92-
S3method(guide_merge,legend)
93-
S3method(guide_train,axis)
94-
S3method(guide_train,bins)
95-
S3method(guide_train,colorbar)
96-
S3method(guide_train,colorsteps)
97-
S3method(guide_train,guide_none)
98-
S3method(guide_train,legend)
99-
S3method(guide_transform,axis)
78+
S3method(guide_gengrob,default)
79+
S3method(guide_geom,default)
80+
S3method(guide_merge,default)
81+
S3method(guide_train,default)
10082
S3method(guide_transform,default)
101-
S3method(guide_transform,guide_none)
10283
S3method(heightDetails,titleGrob)
10384
S3method(heightDetails,zeroGrob)
10485
S3method(interleave,default)
@@ -109,7 +90,6 @@ S3method(limits,POSIXlt)
10990
S3method(limits,character)
11091
S3method(limits,factor)
11192
S3method(limits,numeric)
112-
S3method(makeContent,labelgrob)
11393
S3method(makeContext,dotstackGrob)
11494
S3method(merge_element,default)
11595
S3method(merge_element,element)
@@ -229,6 +209,14 @@ export(GeomText)
229209
export(GeomTile)
230210
export(GeomViolin)
231211
export(GeomVline)
212+
export(Guide)
213+
export(GuideAxis)
214+
export(GuideBins)
215+
export(GuideColourbar)
216+
export(GuideColoursteps)
217+
export(GuideLegend)
218+
export(GuideNone)
219+
export(GuideOld)
232220
export(Layout)
233221
export(Position)
234222
export(PositionDodge)
@@ -473,6 +461,8 @@ export(mean_sdl)
473461
export(mean_se)
474462
export(median_hilow)
475463
export(merge_element)
464+
export(new_guide)
465+
export(old_guide)
476466
export(panel_cols)
477467
export(panel_rows)
478468
export(position_dodge)
@@ -688,6 +678,7 @@ export(theme_test)
688678
export(theme_update)
689679
export(theme_void)
690680
export(transform_position)
681+
export(translate_shape_string)
691682
export(unit)
692683
export(update_geom_defaults)
693684
export(update_labels)

NEWS.md

Lines changed: 128 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,122 @@
11
# ggplot2 (development version)
22

3-
# ggplot2 3.4.3
3+
* The `size` argument in `annotation_logticks()` has been deprecated in favour
4+
of the `linewidth` argument (#5292).
5+
6+
* `geom_boxplot()` gains an `outliers` argument to switch outliers on or off,
7+
in a manner that does affects the scale range. For hiding outliers that does
8+
not affect the scale range, you can continue to use `outlier.shape = NA`
9+
(@teunbrand, #4892).
10+
11+
* Binned scales now treat `NA`s in limits the same way continuous scales do
12+
(#5355).
13+
14+
* Binned scales work better with `trans = "reverse"` (#5355).
15+
16+
* The `legend.text.align` and `legend.title.align` arguments in `theme()` are
17+
deprecated. The `hjust` setting of the `legend.text` and `legend.title`
18+
elements continues to fulfil the role of text alignment (@teunbrand, #5347).
19+
20+
* Integers are once again valid input to theme arguments that expect numeric
21+
input (@teunbrand, #5369)
22+
23+
* Nicer error messages for xlim/ylim arguments in coord-* functions
24+
(@92amartins, #4601, #5297).
25+
26+
* `coord_sf()` now uses customisable guides provided in the scales or
27+
`guides()` function (@teunbrand).
28+
29+
* Legends in `scale_*_manual()` can show `NA` values again when the `values` is
30+
a named vector (@teunbrand, #5214, #5286).
31+
32+
* `scale_*_manual()` with a named `values` argument now emits a warning when
33+
none of those names match the values found in the data (@teunbrand, #5298).
34+
35+
* `coord_munch()` can now close polygon shapes (@teunbrand, #3271)
36+
37+
* You can now omit either `xend` or `yend` from `geom_segment()` as only one
38+
of these is now required. If one is missing, it will be filled from the `x`
39+
and `y` aesthetics respectively. This makes drawing horizontal or vertical
40+
segments a little bit more convenient (@teunbrand, #5140).
41+
42+
* New `plot.tag.location` in `theme()` can control placement of the plot tag
43+
in the `"margin"`, `"plot"` or the new `"panel"` option (#4297).
44+
45+
* `geom_text()` and `geom_label()` gained a `size.unit` parameter that set the
46+
text size to millimetres, points, centimetres, inches or picas
47+
(@teunbrand, #3799).
48+
49+
* The guide system, as the last remaining chunk of ggplot2, has been rewritten
50+
in ggproto. The axes and legends now inherit from a <Guide> class, which makes
51+
them extensible in the same manner as geoms, stats, facets and coords
52+
(#3329, @teunbrand). In addition, the following changes were made:
53+
* A fallback for old S3 guides is encapsulated in the `GuideOld` ggproto
54+
class, which mostly just calls the old S3 generics.
55+
* While the S3 guide generics are still in place, the S3 methods for
56+
`guide_train()`, `guide_merge()`, `guide_geom()`, `guide_transform()`,
57+
`guide_gengrob()` have been superseded by the respective ggproto methods.
58+
In practise, this will mean that `NextMethod()` or sub-classing ggplot2's
59+
guides with the S3 system will no longer work.
60+
* Styling theme parts of the guide now inherit from the plot's theme
61+
(#2728).
62+
* Styling non-theme parts of the guides accept <element> objects, so that
63+
the following is possible: `guide_colourbar(frame = element_rect(...))`.
64+
* Primary axis titles are now placed at the primary guide, so that
65+
`guides(x = guide_axis(position = "top"))` will display the title at the
66+
top by default (#4650).
67+
* Unknown secondary axis guide positions are now inferred as the opposite
68+
of the primary axis guide when the latter has a known `position` (#4650).
69+
* `guide_colourbar()`, `guide_coloursteps()` and `guide_bins()` gain a
70+
`ticks.length` argument.
71+
* In `guide_bins()`, the title no longer arbitrarily becomes offset from
72+
the guide when it has long labels.
73+
* The `order` argument of guides now strictly needs to be a length-1
74+
integer (#4958).
75+
* More informative error for mismatched
76+
`direction`/`theme(legend.direction = ...)` arguments (#4364, #4930).
77+
* `guide_coloursteps()` and `guide_bins()` sort breaks (#5152).
78+
* `guide_axis()` gains a `cap` argument that can be used to trim the
79+
axis line to extreme breaks (#4907).
80+
* `guide_colourbar()` and `guide_coloursteps()` merge properly when one
81+
of aesthetics is dropped (#5324).
82+
* Fixed regression in `guide_legend()` where the `linewidth` key size
83+
wasn't adapted to the width of the lines (#5160).
84+
85+
* `geom_label()` now uses the `angle` aesthetic (@teunbrand, #2785)
86+
* 'lines' units in `geom_label()`, often used in the `label.padding` argument,
87+
are now are relative to the text size. This causes a visual change, but fixes
88+
a misalignment issue between the textbox and text (@teunbrand, #4753)
89+
* The `label.padding` argument in `geom_label()` now supports inputs created
90+
with the `margin()` function (#5030).
91+
* As an internal change, the `titleGrob()` has been refactored to be faster.
92+
* The `translate_shape_string()` internal function is now exported for use in
93+
extensions of point layers (@teunbrand, #5191).
94+
* Fixed bug in `coord_sf()` where graticule lines didn't obey
95+
`panel.grid.major`'s linewidth setting (@teunbrand, #5179)
96+
* Fixed bug in `annotation_logticks()` when no suitable tick positions could
97+
be found (@teunbrand, #5248).
98+
* To improve `width` calculation in bar plots with empty factor levels,
99+
`resolution()` considers `mapped_discrete` values as having resolution 1
100+
(@teunbrand, #5211)
101+
* When `geom_path()` has aesthetics varying within groups, the `arrow()` is
102+
applied to groups instead of individual segments (@teunbrand, #4935).
103+
* The default width of `geom_bar()` is now based on panel-wise resolution of
104+
the data, rather than global resolution (@teunbrand, #4336).
105+
* To apply dodging more consistently in violin plots, `stat_ydensity()` now
106+
has a `drop` argument to keep or discard groups with 1 observation.
107+
* Aesthetics listed in `geom_*()` and `stat_*()` layers now point to relevant
108+
documentation (@teunbrand, #5123).
109+
* `coord_flip()` has been marked as superseded. The recommended alternative is
110+
to swap the `x` and `y` aesthetic and/or using the `orientation` argument in
111+
a layer (@teunbrand, #5130).
112+
* `stat_align()` is now applied per panel instead of globally, preventing issues
113+
when facets have different ranges (@teunbrand, #5227).
114+
* A stacking bug in `stat_align()` was fixed (@teunbrand, #5176).
115+
* `stat_contour()` and `stat_contour_filled()` now warn about and remove
116+
duplicated coordinates (@teunbrand, #5215).
117+
* Improve performance of layers without positional scales (@zeehio, #4990)
4118

119+
# ggplot2 3.4.3
5120
This hotfix release addresses a version comparison change in r-devel. There are
6121
no user-facing or breaking changes.
7122

@@ -43,7 +158,7 @@ changes and a few bug fixes as well.
43158

44159
* Fixed bug in `coord_sf()` where graticule lines didn't obey
45160
`panel.grid.major`'s linewidth setting (@teunbrand, #5179).
46-
161+
47162
* `geom_text()` drops observations where `angle = NA` instead of throwing an
48163
error (@teunbrand, #2757).
49164

@@ -420,7 +535,7 @@ small selection of feature refinements.
420535
(@thomasp85, #4149)
421536

422537
* Fix bug in `scale_[x|y]_date()` where custom breaks functions that resulted in
423-
fracional dates would get misaligned (@thomasp85, #3965)
538+
fractional dates would get misaligned (@thomasp85, #3965)
424539

425540
* Fix bug in `scale_[x|y]_datetime()` where a specified timezone would be
426541
ignored by the scale (@thomasp85, #4007)
@@ -446,7 +561,7 @@ small selection of feature refinements.
446561
and plots are faceted with multi-layered strips (@teunbrand, #4384).
447562

448563
* Using `theme(aspect.ratio = ...)` together with free space in `facet_grid()`
449-
now crrectly throws an error (@thomasp85, #3834)
564+
now correctly throws an error (@thomasp85, #3834)
450565

451566
* Fixed a bug in `labeller()` so that `.default` is passed to `as_labeller()`
452567
when labellers are specified by naming faceting variables. (@waltersom, #4031)
@@ -715,7 +830,7 @@ fixing some unit tests that broke due to upstream changes.
715830
with ribbons that spanned `y = 0` (#3471)
716831
* Using `qplot()` with a single positional aesthetic will no longer title the
717832
non-specified scale as `"NULL"` (#3473)
718-
* Fixes unit tests for sf graticule labels caused by chages to sf
833+
* Fixes unit tests for sf graticule labels caused by changes to sf
719834

720835
# ggplot2 3.2.0
721836

@@ -1061,7 +1176,7 @@ accompanying issue #2890.
10611176
* Error: `data` must be uniquely named but has duplicate columns
10621177

10631178
If layer data contains columns with identical names an error will be
1064-
thrown. In earlier versions the first occuring column was chosen silently,
1179+
thrown. In earlier versions the first occurring column was chosen silently,
10651180
potentially masking that the wrong data was chosen.
10661181

10671182
* Error: Aesthetics must be either length 1 or the same as the data
@@ -1549,7 +1664,7 @@ The facet system, as well as the internal panel class, has been rewritten in
15491664
ggproto. Facets are now extendable in the same manner as geoms and stats, as
15501665
described in `vignette("extending-ggplot2")`.
15511666
1552-
We have also added the following new fatures.
1667+
We have also added the following new features.
15531668
15541669
* `facet_grid()` and `facet_wrap()` now allow expressions in their faceting
15551670
formulas (@DanRuderman, #1596).
@@ -1599,7 +1714,7 @@ re-installation of all extension packages.
15991714
### Date time
16001715
16011716
* `scale_*_datetime()` now supports time zones. It will use the timezone
1602-
attached to the varaible by default, but can be overridden with the
1717+
attached to the variable by default, but can be overridden with the
16031718
`timezone` argument.
16041719
16051720
* New `scale_x_time()` and `scale_y_time()` generate reasonable default
@@ -1625,7 +1740,7 @@ Compared to the previous version of ggplot2, there are three main changes:
16251740
1. `scale_x_discrete()` and `scale_y_discrete()` always show discrete NA,
16261741
regardless of their source
16271742
1628-
1. If present, `NA`s are shown in discete legends.
1743+
1. If present, `NA`s are shown in discrete legends.
16291744
16301745
1. All discrete scales gain a `na.translate` argument that allows you to
16311746
control whether `NA`s are translated to something that can be visualised,
@@ -1706,7 +1821,7 @@ There were a number of tweaks to the theme elements that control legends:
17061821

17071822
* `geom_contour()` more clearly describes what inputs it needs (#1577).
17081823

1709-
* `geom_curve()` respects the `lineend` paramater (#1852).
1824+
* `geom_curve()` respects the `lineend` parameter (#1852).
17101825

17111826
* `geom_histogram()` and `stat_bin()` understand the `breaks` parameter once
17121827
more. (#1665). The floating point adjustment for histogram bins is now
@@ -2193,7 +2308,7 @@ version of ggplot.
21932308
inline with the 2nd edition of the ggplot2 box, which minimises the use of
21942309
`qplot()` in favour of `ggplot()`.
21952310

2196-
* Tighly linked geoms and stats (e.g. `geom_boxplot()` and `stat_boxplot()`)
2311+
* Tightly linked geoms and stats (e.g. `geom_boxplot()` and `stat_boxplot()`)
21972312
are now documented in the same file so you can see all the arguments in one
21982313
place. Variations of the same idea (e.g. `geom_path()`, `geom_line()`, and
21992314
`geom_step()`) are also documented together.
@@ -2296,7 +2411,7 @@ version of ggplot.
22962411
* `geom_segment()` annotations were not transforming with scales
22972412
(@BrianDiggs, #859).
22982413
2299-
* `geom_smooth()` is no longer so chatty. If you want to know what the deafult
2414+
* `geom_smooth()` is no longer so chatty. If you want to know what the default
23002415
smoothing method is, look it up in the documentation! (#1247)
23012416
23022417
* `geom_violin()` now has the ability to draw quantile lines (@DanRuderman).
@@ -2328,7 +2443,7 @@ version of ggplot.
23282443
23292444
* You can now suppress the appearance of an axis/legend title (and the space
23302445
that would allocated for it) with `NULL` in the `scale_` function. To
2331-
use the default lable, use `waiver()` (#1145).
2446+
use the default label, use `waiver()` (#1145).
23322447
23332448
* Position adjustments no longer warn about potentially varying ranges
23342449
because the problem rarely occurs in practice and there are currently a

R/aes-colour-fill-alpha.R

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
#'
99
#' @section Colour and fill:
1010
#'
11+
#' The `colour` aesthetic is used to draw lines and strokes, such as in
12+
#' [`geom_point()`] and [`geom_line()`], but also the line contours of
13+
#' [`geom_rect()`] and [`geom_polygon()`]. The `fill` aesthetic is used to
14+
#' colour the inside areas of geoms, such as [`geom_rect()`] and
15+
#' [`geom_polygon()`], but also the insides of shapes 21-25 of [`geom_point()`].
16+
#'
1117
#' Colours and fills can be specified in the following ways:
1218
#' * A name, e.g., `"red"`. R has 657 built-in named colours, which can be
1319
#' listed with [grDevices::colors()].
@@ -38,9 +44,11 @@
3844
#' [scale_fill_gradient()], [scale_fill_grey()],
3945
#' [scale_fill_hue()], [scale_fill_identity()],
4046
#' [scale_fill_manual()], [scale_fill_viridis_d()]
41-
#' * Other options for modifying alpha: [scale_alpha()]
42-
#' * Run `vignette("ggplot2-specs")` to see an overview of other aesthestics that
47+
#' * Other options for modifying alpha:
48+
#' [scale_alpha()], [scale_alpha_manual()], [scale_alpha_identity()]
49+
#' * Run `vignette("ggplot2-specs")` to see an overview of other aesthetics that
4350
#' can be modified.
51+
#' @family aesthetics documentation
4452
#'
4553
#' @name aes_colour_fill_alpha
4654
#' @aliases colour color fill

0 commit comments

Comments
 (0)