Skip to content

Commit

Permalink
Merge branch 'main' into v3.4.3-rc
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasp85 authored Aug 14, 2023
2 parents e89befc + 2cd0e96 commit 62a5f4a
Show file tree
Hide file tree
Showing 322 changed files with 7,718 additions and 4,431 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
cache-version: 3
extra-packages: >
any::rcmdcheck,
Hmisc=?ignore-before-r=3.6.0,
Hmisc=?ignore-before-r=4.1.0,
quantreg=?ignore-before-r=3.6.0,
needs: check

Expand Down
12 changes: 6 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ Suggests:
hexbin,
Hmisc,
knitr,
lattice,
mapproj,
maps,
maptools,
Expand All @@ -63,7 +62,6 @@ Suggests:
quantreg,
ragg,
RColorBrewer,
rgeos,
rmarkdown,
rpart,
sf (>= 0.7-3),
Expand Down Expand Up @@ -175,20 +173,22 @@ Collate:
'grob-dotstack.R'
'grob-null.R'
'grouping.R'
'guide-.R'
'guide-axis.R'
'guide-legend.R'
'guide-bins.R'
'guide-colorbar.R'
'guide-colorsteps.R'
'guide-legend.R'
'layer.R'
'guide-none.R'
'guide-old.R'
'guides-.R'
'guides-axis.R'
'guides-grid.R'
'guides-none.R'
'hexbin.R'
'import-standalone-obj-type.R'
'import-standalone-types-check.R'
'labeller.R'
'labels.R'
'layer.R'
'layer-sf.R'
'layout.R'
'limits.R'
Expand Down
41 changes: 16 additions & 25 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ S3method(ggplot_add,"NULL")
S3method(ggplot_add,"function")
S3method(ggplot_add,Coord)
S3method(ggplot_add,Facet)
S3method(ggplot_add,Guides)
S3method(ggplot_add,Layer)
S3method(ggplot_add,Scale)
S3method(ggplot_add,by)
S3method(ggplot_add,data.frame)
S3method(ggplot_add,default)
S3method(ggplot_add,guides)
S3method(ggplot_add,labels)
S3method(ggplot_add,list)
S3method(ggplot_add,theme)
Expand All @@ -75,30 +75,11 @@ S3method(grobWidth,absoluteGrob)
S3method(grobWidth,zeroGrob)
S3method(grobX,absoluteGrob)
S3method(grobY,absoluteGrob)
S3method(guide_gengrob,axis)
S3method(guide_gengrob,bins)
S3method(guide_gengrob,colorbar)
S3method(guide_gengrob,guide_none)
S3method(guide_gengrob,legend)
S3method(guide_geom,axis)
S3method(guide_geom,bins)
S3method(guide_geom,colorbar)
S3method(guide_geom,guide_none)
S3method(guide_geom,legend)
S3method(guide_merge,axis)
S3method(guide_merge,bins)
S3method(guide_merge,colorbar)
S3method(guide_merge,guide_none)
S3method(guide_merge,legend)
S3method(guide_train,axis)
S3method(guide_train,bins)
S3method(guide_train,colorbar)
S3method(guide_train,colorsteps)
S3method(guide_train,guide_none)
S3method(guide_train,legend)
S3method(guide_transform,axis)
S3method(guide_gengrob,default)
S3method(guide_geom,default)
S3method(guide_merge,default)
S3method(guide_train,default)
S3method(guide_transform,default)
S3method(guide_transform,guide_none)
S3method(heightDetails,titleGrob)
S3method(heightDetails,zeroGrob)
S3method(interleave,default)
Expand All @@ -109,7 +90,6 @@ S3method(limits,POSIXlt)
S3method(limits,character)
S3method(limits,factor)
S3method(limits,numeric)
S3method(makeContent,labelgrob)
S3method(makeContext,dotstackGrob)
S3method(merge_element,default)
S3method(merge_element,element)
Expand Down Expand Up @@ -229,6 +209,14 @@ export(GeomText)
export(GeomTile)
export(GeomViolin)
export(GeomVline)
export(Guide)
export(GuideAxis)
export(GuideBins)
export(GuideColourbar)
export(GuideColoursteps)
export(GuideLegend)
export(GuideNone)
export(GuideOld)
export(Layout)
export(Position)
export(PositionDodge)
Expand Down Expand Up @@ -473,6 +461,8 @@ export(mean_sdl)
export(mean_se)
export(median_hilow)
export(merge_element)
export(new_guide)
export(old_guide)
export(panel_cols)
export(panel_rows)
export(position_dodge)
Expand Down Expand Up @@ -688,6 +678,7 @@ export(theme_test)
export(theme_update)
export(theme_void)
export(transform_position)
export(translate_shape_string)
export(unit)
export(update_geom_defaults)
export(update_labels)
Expand Down
141 changes: 128 additions & 13 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,122 @@
# ggplot2 (development version)

# ggplot2 3.4.3
* The `size` argument in `annotation_logticks()` has been deprecated in favour
of the `linewidth` argument (#5292).

* `geom_boxplot()` gains an `outliers` argument to switch outliers on or off,
in a manner that does affects the scale range. For hiding outliers that does
not affect the scale range, you can continue to use `outlier.shape = NA`
(@teunbrand, #4892).

* Binned scales now treat `NA`s in limits the same way continuous scales do
(#5355).

* Binned scales work better with `trans = "reverse"` (#5355).

* The `legend.text.align` and `legend.title.align` arguments in `theme()` are
deprecated. The `hjust` setting of the `legend.text` and `legend.title`
elements continues to fulfil the role of text alignment (@teunbrand, #5347).

* Integers are once again valid input to theme arguments that expect numeric
input (@teunbrand, #5369)

* Nicer error messages for xlim/ylim arguments in coord-* functions
(@92amartins, #4601, #5297).

* `coord_sf()` now uses customisable guides provided in the scales or
`guides()` function (@teunbrand).

* Legends in `scale_*_manual()` can show `NA` values again when the `values` is
a named vector (@teunbrand, #5214, #5286).

* `scale_*_manual()` with a named `values` argument now emits a warning when
none of those names match the values found in the data (@teunbrand, #5298).

* `coord_munch()` can now close polygon shapes (@teunbrand, #3271)

* You can now omit either `xend` or `yend` from `geom_segment()` as only one
of these is now required. If one is missing, it will be filled from the `x`
and `y` aesthetics respectively. This makes drawing horizontal or vertical
segments a little bit more convenient (@teunbrand, #5140).

* New `plot.tag.location` in `theme()` can control placement of the plot tag
in the `"margin"`, `"plot"` or the new `"panel"` option (#4297).

* `geom_text()` and `geom_label()` gained a `size.unit` parameter that set the
text size to millimetres, points, centimetres, inches or picas
(@teunbrand, #3799).

* The guide system, as the last remaining chunk of ggplot2, has been rewritten
in ggproto. The axes and legends now inherit from a <Guide> class, which makes
them extensible in the same manner as geoms, stats, facets and coords
(#3329, @teunbrand). In addition, the following changes were made:
* A fallback for old S3 guides is encapsulated in the `GuideOld` ggproto
class, which mostly just calls the old S3 generics.
* While the S3 guide generics are still in place, the S3 methods for
`guide_train()`, `guide_merge()`, `guide_geom()`, `guide_transform()`,
`guide_gengrob()` have been superseded by the respective ggproto methods.
In practise, this will mean that `NextMethod()` or sub-classing ggplot2's
guides with the S3 system will no longer work.
* Styling theme parts of the guide now inherit from the plot's theme
(#2728).
* Styling non-theme parts of the guides accept <element> objects, so that
the following is possible: `guide_colourbar(frame = element_rect(...))`.
* Primary axis titles are now placed at the primary guide, so that
`guides(x = guide_axis(position = "top"))` will display the title at the
top by default (#4650).
* Unknown secondary axis guide positions are now inferred as the opposite
of the primary axis guide when the latter has a known `position` (#4650).
* `guide_colourbar()`, `guide_coloursteps()` and `guide_bins()` gain a
`ticks.length` argument.
* In `guide_bins()`, the title no longer arbitrarily becomes offset from
the guide when it has long labels.
* The `order` argument of guides now strictly needs to be a length-1
integer (#4958).
* More informative error for mismatched
`direction`/`theme(legend.direction = ...)` arguments (#4364, #4930).
* `guide_coloursteps()` and `guide_bins()` sort breaks (#5152).
* `guide_axis()` gains a `cap` argument that can be used to trim the
axis line to extreme breaks (#4907).
* `guide_colourbar()` and `guide_coloursteps()` merge properly when one
of aesthetics is dropped (#5324).
* Fixed regression in `guide_legend()` where the `linewidth` key size
wasn't adapted to the width of the lines (#5160).

* `geom_label()` now uses the `angle` aesthetic (@teunbrand, #2785)
* 'lines' units in `geom_label()`, often used in the `label.padding` argument,
are now are relative to the text size. This causes a visual change, but fixes
a misalignment issue between the textbox and text (@teunbrand, #4753)
* The `label.padding` argument in `geom_label()` now supports inputs created
with the `margin()` function (#5030).
* As an internal change, the `titleGrob()` has been refactored to be faster.
* The `translate_shape_string()` internal function is now exported for use in
extensions of point layers (@teunbrand, #5191).
* Fixed bug in `coord_sf()` where graticule lines didn't obey
`panel.grid.major`'s linewidth setting (@teunbrand, #5179)
* Fixed bug in `annotation_logticks()` when no suitable tick positions could
be found (@teunbrand, #5248).
* To improve `width` calculation in bar plots with empty factor levels,
`resolution()` considers `mapped_discrete` values as having resolution 1
(@teunbrand, #5211)
* When `geom_path()` has aesthetics varying within groups, the `arrow()` is
applied to groups instead of individual segments (@teunbrand, #4935).
* The default width of `geom_bar()` is now based on panel-wise resolution of
the data, rather than global resolution (@teunbrand, #4336).
* To apply dodging more consistently in violin plots, `stat_ydensity()` now
has a `drop` argument to keep or discard groups with 1 observation.
* Aesthetics listed in `geom_*()` and `stat_*()` layers now point to relevant
documentation (@teunbrand, #5123).
* `coord_flip()` has been marked as superseded. The recommended alternative is
to swap the `x` and `y` aesthetic and/or using the `orientation` argument in
a layer (@teunbrand, #5130).
* `stat_align()` is now applied per panel instead of globally, preventing issues
when facets have different ranges (@teunbrand, #5227).
* A stacking bug in `stat_align()` was fixed (@teunbrand, #5176).
* `stat_contour()` and `stat_contour_filled()` now warn about and remove
duplicated coordinates (@teunbrand, #5215).
* Improve performance of layers without positional scales (@zeehio, #4990)

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

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

* Fixed bug in `coord_sf()` where graticule lines didn't obey
`panel.grid.major`'s linewidth setting (@teunbrand, #5179).

* `geom_text()` drops observations where `angle = NA` instead of throwing an
error (@teunbrand, #2757).

Expand Down Expand Up @@ -420,7 +535,7 @@ small selection of feature refinements.
(@thomasp85, #4149)

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

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

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

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

# ggplot2 3.2.0

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

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

* Error: Aesthetics must be either length 1 or the same as the data
Expand Down Expand Up @@ -1549,7 +1664,7 @@ 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")`.
We have also added the following new fatures.
We have also added the following new features.
* `facet_grid()` and `facet_wrap()` now allow expressions in their faceting
formulas (@DanRuderman, #1596).
Expand Down Expand Up @@ -1599,7 +1714,7 @@ re-installation of all extension packages.
### Date time
* `scale_*_datetime()` now supports time zones. It will use the timezone
attached to the varaible by default, but can be overridden with the
attached to the variable by default, but can be overridden with the
`timezone` argument.
* New `scale_x_time()` and `scale_y_time()` generate reasonable default
Expand All @@ -1625,7 +1740,7 @@ Compared to the previous version of ggplot2, there are three main changes:
1. `scale_x_discrete()` and `scale_y_discrete()` always show discrete NA,
regardless of their source
1. If present, `NA`s are shown in discete legends.
1. If present, `NA`s are shown in discrete legends.
1. All discrete scales gain a `na.translate` argument that allows you to
control whether `NA`s are translated to something that can be visualised,
Expand Down Expand Up @@ -1706,7 +1821,7 @@ There were a number of tweaks to the theme elements that control legends:

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

* `geom_curve()` respects the `lineend` paramater (#1852).
* `geom_curve()` respects the `lineend` parameter (#1852).

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

* Tighly linked geoms and stats (e.g. `geom_boxplot()` and `stat_boxplot()`)
* Tightly linked geoms and stats (e.g. `geom_boxplot()` and `stat_boxplot()`)
are now documented in the same file so you can see all the arguments in one
place. Variations of the same idea (e.g. `geom_path()`, `geom_line()`, and
`geom_step()`) are also documented together.
Expand Down Expand Up @@ -2296,7 +2411,7 @@ version of ggplot.
* `geom_segment()` annotations were not transforming with scales
(@BrianDiggs, #859).
* `geom_smooth()` is no longer so chatty. If you want to know what the deafult
* `geom_smooth()` is no longer so chatty. If you want to know what the default
smoothing method is, look it up in the documentation! (#1247)
* `geom_violin()` now has the ability to draw quantile lines (@DanRuderman).
Expand Down Expand Up @@ -2328,7 +2443,7 @@ version of ggplot.
* You can now suppress the appearance of an axis/legend title (and the space
that would allocated for it) with `NULL` in the `scale_` function. To
use the default lable, use `waiver()` (#1145).
use the default label, use `waiver()` (#1145).
* Position adjustments no longer warn about potentially varying ranges
because the problem rarely occurs in practice and there are currently a
Expand Down
12 changes: 10 additions & 2 deletions R/aes-colour-fill-alpha.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
#'
#' @section Colour and fill:
#'
#' The `colour` aesthetic is used to draw lines and strokes, such as in
#' [`geom_point()`] and [`geom_line()`], but also the line contours of
#' [`geom_rect()`] and [`geom_polygon()`]. The `fill` aesthetic is used to
#' colour the inside areas of geoms, such as [`geom_rect()`] and
#' [`geom_polygon()`], but also the insides of shapes 21-25 of [`geom_point()`].
#'
#' Colours and fills can be specified in the following ways:
#' * A name, e.g., `"red"`. R has 657 built-in named colours, which can be
#' listed with [grDevices::colors()].
Expand Down Expand Up @@ -38,9 +44,11 @@
#' [scale_fill_gradient()], [scale_fill_grey()],
#' [scale_fill_hue()], [scale_fill_identity()],
#' [scale_fill_manual()], [scale_fill_viridis_d()]
#' * Other options for modifying alpha: [scale_alpha()]
#' * Run `vignette("ggplot2-specs")` to see an overview of other aesthestics that
#' * Other options for modifying alpha:
#' [scale_alpha()], [scale_alpha_manual()], [scale_alpha_identity()]
#' * Run `vignette("ggplot2-specs")` to see an overview of other aesthetics that
#' can be modified.
#' @family aesthetics documentation
#'
#' @name aes_colour_fill_alpha
#' @aliases colour color fill
Expand Down
Loading

0 comments on commit 62a5f4a

Please sign in to comment.