Skip to content

Commit 915d050

Browse files
committed
Merge branch 'main' into rect_key
2 parents ee8bd00 + 016b78f commit 915d050

File tree

282 files changed

+23328
-26117
lines changed

Some content is hidden

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

282 files changed

+23328
-26117
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ Collate:
242242
'scales-.R'
243243
'stat-align.R'
244244
'stat-bin.R'
245+
'stat-summary-2d.R'
245246
'stat-bin2d.R'
246247
'stat-bindot.R'
247248
'stat-binhex.R'
@@ -263,7 +264,6 @@ Collate:
263264
'stat-smooth-methods.R'
264265
'stat-smooth.R'
265266
'stat-sum.R'
266-
'stat-summary-2d.R'
267267
'stat-summary-bin.R'
268268
'stat-summary-hex.R'
269269
'stat-summary.R'
@@ -274,6 +274,7 @@ Collate:
274274
'theme.R'
275275
'theme-defaults.R'
276276
'theme-current.R'
277+
'theme-sub.R'
277278
'utilities-break.R'
278279
'utilities-grid.R'
279280
'utilities-help.R'

NAMESPACE

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ S3method(c,mapped_discrete)
2020
S3method(drawDetails,zeroGrob)
2121
S3method(element_grob,element_blank)
2222
S3method(element_grob,element_line)
23+
S3method(element_grob,element_point)
24+
S3method(element_grob,element_polygon)
2325
S3method(element_grob,element_rect)
2426
S3method(element_grob,element_text)
2527
S3method(format,ggproto)
@@ -346,6 +348,8 @@ export(element_blank)
346348
export(element_geom)
347349
export(element_grob)
348350
export(element_line)
351+
export(element_point)
352+
export(element_polygon)
349353
export(element_rect)
350354
export(element_render)
351355
export(element_text)
@@ -725,8 +729,18 @@ export(theme_linedraw)
725729
export(theme_minimal)
726730
export(theme_replace)
727731
export(theme_set)
732+
export(theme_sub_axis)
733+
export(theme_sub_axis_bottom)
734+
export(theme_sub_axis_left)
735+
export(theme_sub_axis_right)
736+
export(theme_sub_axis_top)
737+
export(theme_sub_axis_x)
738+
export(theme_sub_axis_y)
739+
export(theme_sub_legend)
740+
export(theme_sub_panel)
741+
export(theme_sub_plot)
742+
export(theme_sub_strip)
728743
export(theme_test)
729-
export(theme_transparent)
730744
export(theme_update)
731745
export(theme_void)
732746
export(transform_position)

NEWS.md

Lines changed: 87 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,54 @@
11
# ggplot2 (development version)
22

3+
* Fixed regression with incorrectly drawn gridlines when using `coord_flip()`
4+
(@teunbrand, #6293).
5+
* Deprecated functions and arguments prior to ggplot2 3.0.0 throw errors instead
6+
of warnings.
7+
* Functions and arguments that were soft-deprecated up to ggplot2 3.4.0 now
8+
throw warnings.
9+
* (internal) layer data can be attenuated with parameter attributes
10+
(@teunbrand, #3175).
11+
* Date scales silently coerce <POSIXct> to <Date> and datetime scales silently
12+
coerce <Date> to <POSIXct> (@laurabrianna, #3533)
13+
* New parameters for `geom_label()` (@teunbrand and @steveharoz, #5365):
14+
* The `linewidth` aesthetic is now applied and replaces the `label.size`
15+
argument.
16+
* The `linetype` aesthetic is now applied.
17+
* New `border.colour` argument to set the colour of borders.
18+
* New `text.colour` argument to set the colour of text.
19+
* New `element_point()` and `element_polygon()` that can be given to
20+
`theme(point, polygon)` as an extension point (@teunbrand, #6248).
21+
* Turned off fallback for `size` to `linewidth` translation in
22+
`geom_bar()`/`geom_col()` (#4848).
23+
* `coord_radial()` now displays no axis instead of throwing an error when
24+
a scale has no breaks (@teunbrand, #6271).
25+
* The `fatten` argument has been deprecated in `geom_boxplot()`,
26+
`geom_crossbar()` and `geom_pointrange()` (@teunbrand, #4881).
27+
* Axis labels are now preserved better when using `coord_sf(expand = TRUE)` and
28+
graticule lines are straight but do not meet the edge (@teunbrand, #2985).
29+
* Attempt to boost detail in `coord_polar()` and `coord_radial()` near the
30+
center (@teunbrand, #5023)
31+
* Scale names, guide titles and aesthetic labels can now accept functions
32+
(@teunbrand, #4313)
33+
* Binned scales with zero-width data expand the default limits by 0.1
34+
(@teunbrand, #5066)
35+
* New default `geom_qq_line(geom = "abline")` for better clipping in the
36+
vertical direction. In addition, `slope` and `intercept` are new computed
37+
variables in `stat_qq_line()` (@teunbrand, #6087).
38+
* Position adjustments can now have auxiliary aesthetics (@teunbrand).
39+
* `position_nudge()` gains `nudge_x` and `nudge_y` aesthetics (#3026, #5445).
40+
* `position_dodge()` gains `order` aesthetic (#3022, #3345)
41+
* More stability for vctrs-based palettes (@teunbrand, #6117).
42+
* Fixed regression in `guide_bins(reverse = TRUE)` (@teunbrand, #6183).
43+
* New function family for setting parts of a theme. For example, you can now use
44+
`theme_sub_axis(line, text, ticks, ticks.length, line)` as a substitute for
45+
`theme(axis.line, axis.text, axis.ticks, axis.ticks.length, axis.line)`. This
46+
should allow slightly terser and more organised theme declarations
47+
(@teunbrand, #5301).
48+
* `scale_{x/y}_discrete(continuous.limits)` is a new argument to control the
49+
display range of discrete scales (@teunbrand, #4174, #6259).
50+
* `geom_ribbon()` now appropriately warns about, and removes, missing values
51+
(@teunbrand, #6243).
352
* `guide_*()` can now accept two inside legend theme elements:
453
`legend.position.inside` and `legend.justification.inside`, allowing inside
554
legends to be placed at different positions. Only inside legends with the same
@@ -42,6 +91,13 @@
4291
(@teunbrand, #4320)
4392
* `geom_boxplot()` gains additional arguments to style the colour, linetype and
4493
linewidths of the box, whiskers, median line and staples (@teunbrand, #5126)
94+
* `geom_violin()` gains additional arguments to style the colour, linetype and
95+
linewidths of the quantiles, which replace the now-deprecated `draw_quantiles`
96+
argument (#5912).
97+
* (breaking) `geom_violin(quantiles)` now has actual quantiles based on
98+
the data, rather than inferred quantiles based on the computed density. The
99+
`quantiles` parameter that replaces `draw_quantiles` now belongs to
100+
`stat_ydensity()` instead of `geom_violin()` (@teunbrand, #4120).
45101
* (internal) Using `after_scale()` in the `Geom*$default_aes()` field is now
46102
evaluated in the context of data (@teunbrand, #6135)
47103
* Fixed bug where binned scales wouldn't simultaneously accept transformations
@@ -224,13 +280,16 @@
224280
is setup once in total instead of once per group (@teunbrand, #5971)
225281
* `facet_grid(space = "free")` can now be combined with `coord_fixed()`
226282
(@teunbrand, #4584).
227-
* `theme_classic()` now has black ticks and text instead of dark gray. In
228-
addition, `theme_classic()`'s axis line end is `"square"` (@teunbrand, #5978).
283+
* `theme_classic()` has the following changes (@teunbrand, #5978 & #6320):
284+
* Axis ticks are now black (`ink`-coloured) instead of dark gray.
285+
* Axis line ends are now `"square"`.
286+
* The panel grid is now blank at the `panel.grid` hierarchy level instead of
287+
the `panel.grid.major` and `panel.grid.minor` levels.
229288
* {tibble} is now suggested instead of imported (@teunbrand, #5986)
230289
* The ellipsis argument is now checked in `fortify()`, `get_alt_text()`,
231290
`labs()` and several guides (@teunbrand, #3196).
232291
* `stat_summary_bin()` no longer ignores `width` parameter (@teunbrand, #4647).
233-
* Added `keep.zeroes` argument to `stat_bin()` (@teunbrand, #3449)
292+
* Reintroduced `drop` argument to `stat_bin()` (@teunbrand, #3449)
234293
* (internal) removed barriers for using 2D structures as aesthetics
235294
(@teunbrand, #4189).
236295
* `coord_sf()` no longer errors when dealing with empty graticules (@teunbrand, #6052)
@@ -243,6 +302,31 @@
243302
* `geom_abline()` clips to the panel range in the vertical direction too
244303
(@teunbrand, #6086).
245304
* Added `panel.widths` and `panel.heights` to `theme()` (#5338, @teunbrand).
305+
* Standardised the calculation of `width`, which are now implemented as
306+
aesthetics (@teunbrand, #2800).
307+
* Stricter check on `register_theme_elements(element_tree)` (@teunbrand, #6162)
308+
* Added `weight` aesthetic for `stat_ellipse()` (@teunbrand, #5272)
309+
* Fixed a bug where the `guide_custom(order)` wasn't working (@teunbrand, #6195)
310+
* All binning stats now use the `boundary`/`center` parametrisation rather
311+
than `origin`, following in `stat_bin()`'s footsteps (@teunbrand).
312+
* `stat_summary_2d()` and `stat_bin_2d()` now deal with zero-range data
313+
more elegantly (@teunbrand, #6207).
314+
* Munching in `coord_polar()` and `coord_radial()` now adds more detail,
315+
particularly for data-points with a low radius near the center
316+
(@teunbrand, #5023).
317+
* All scales now expose the `aesthetics` parameter (@teunbrand, #5841)
318+
* Staged expressions are handled more gracefully if legends cannot resolve them
319+
(@teunbrand, #6264).
320+
* New `theme(legend.key.justification)` to control the alignment of legend keys
321+
(@teunbrand, #3669).
322+
* Added `scale_{x/y}_time(date_breaks, date_minor_breaks, date_labels)`
323+
(@teunbrand, #4335).
324+
* `ggsave()` can write a multi-page pdf file when provided with a list of plots
325+
(@teunbrand, #5093).
326+
* (internal) When `validate_subclass()` fails to find a class directly, it tries
327+
to retrieve the class via constructor functions (@teunbrand).
328+
* (internal) The ViewScale class has a `make_fixed_copy()` method to permit
329+
copying trained position scales (#3441).
246330

247331
# ggplot2 3.5.1
248332

R/aes.R

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ NULL
3838
#'
3939
#' [Delayed evaluation][aes_eval] for working with computed variables.
4040
#'
41+
#' @note
42+
#' Using `I()` to create objects of class 'AsIs' causes scales to ignore the
43+
#' variable and assumes the wrapped variable is direct input for the grid
44+
#' package. Please be aware that variables are sometimes combined, like in
45+
#' some stats or position adjustments, that may yield unexpected results with
46+
#' 'AsIs' variables.
47+
#'
4148
#' @family aesthetics documentation
4249
#' @return A list with class `uneval`. Components of the list are either
4350
#' quosures or constants.
@@ -283,7 +290,7 @@ is_position_aes <- function(vars) {
283290
#'
284291
#' @export
285292
aes_ <- function(x, y, ...) {
286-
deprecate_soft0(
293+
deprecate_warn0(
287294
"3.0.0",
288295
"aes_()",
289296
details = "Please use tidy evaluation idioms with `aes()`"
@@ -310,7 +317,7 @@ aes_ <- function(x, y, ...) {
310317
#' @rdname aes_
311318
#' @export
312319
aes_string <- function(x, y, ...) {
313-
deprecate_soft0(
320+
deprecate_warn0(
314321
"3.0.0",
315322
"aes_string()",
316323
details = c(
@@ -353,7 +360,7 @@ aes_all <- function(vars) {
353360
# refer to the data mask
354361
structure(
355362
lapply(vars, function(x) new_quosure(as.name(x), emptyenv())),
356-
class = "uneval"
363+
class = c("unlabelled_uneval", "uneval")
357364
)
358365
}
359366

@@ -367,29 +374,7 @@ aes_all <- function(vars) {
367374
#' @keywords internal
368375
#' @export
369376
aes_auto <- function(data = NULL, ...) {
370-
deprecate_warn0("2.0.0", "aes_auto()")
371-
372-
# detect names of data
373-
if (is.null(data)) {
374-
cli::cli_abort("{.fn aes_auto} requires a {.cls data.frame} or names of data.frame.")
375-
} else if (is.data.frame(data)) {
376-
vars <- names(data)
377-
} else {
378-
vars <- data
379-
}
380-
381-
# automatically detected aes
382-
vars <- intersect(ggplot_global$all_aesthetics, vars)
383-
names(vars) <- vars
384-
aes <- lapply(vars, function(x) parse(text = x)[[1]])
385-
386-
# explicitly defined aes
387-
if (length(match.call()) > 2) {
388-
args <- as.list(match.call()[-1])
389-
aes <- c(aes, args[names(args) != "data"])
390-
}
391-
392-
structure(rename_aes(aes), class = "uneval")
377+
lifecycle::deprecate_stop("2.0.0", "aes_auto()")
393378
}
394379

395380
mapped_aesthetics <- function(x) {

R/annotation-custom.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ GeomCustomAnn <- ggproto("GeomCustomAnn", Geom,
8080
editGrob(grob, vp = vp, name = paste(grob$name, annotation_id()))
8181
},
8282

83-
default_aes = aes_(xmin = -Inf, xmax = Inf, ymin = -Inf, ymax = Inf)
83+
default_aes = aes(xmin = -Inf, xmax = Inf, ymin = -Inf, ymax = Inf)
8484
)
8585

8686
annotation_id <- local({

R/annotation-logticks.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ GeomLogticks <- ggproto("GeomLogticks", Geom,
229229
},
230230

231231
default_aes = aes(
232-
colour = from_theme(ink),
232+
colour = from_theme(colour %||% ink),
233233
linewidth = from_theme(linewidth),
234234
linetype = from_theme(linetype),
235235
alpha = 1

R/axis-secondary.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ AxisSecondary <- ggproto("AxisSecondary", NULL,
329329
scale$train(range)
330330
scale
331331
},
332-
make_title = function(title) {
333-
title
332+
make_title = function(...) {
333+
ScaleContinuous$make_title(...)
334334
}
335335
)

0 commit comments

Comments
 (0)