Skip to content

Commit 5272850

Browse files
committed
fix merge conflict
Merge branch 'main' into scale_experiment # Conflicts: # R/scale-.R # R/scales-.R # tests/testthat/test-scales.R
2 parents 8d5c69d + 1bfb3c9 commit 5272850

File tree

273 files changed

+6057
-2253
lines changed

Some content is hidden

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

273 files changed

+6057
-2253
lines changed

DESCRIPTION

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Imports:
4444
vctrs (>= 0.6.0),
4545
withr (>= 2.5.0)
4646
Suggests:
47+
broom,
4748
covr,
4849
dplyr,
4950
ggplot2movies,
@@ -126,15 +127,15 @@ Collate:
126127
'facet-grid-.R'
127128
'facet-null.R'
128129
'facet-wrap.R'
129-
'fortify-lm.R'
130130
'fortify-map.R'
131-
'fortify-multcomp.R'
131+
'fortify-models.R'
132132
'fortify-spatial.R'
133133
'fortify.R'
134134
'stat-.R'
135135
'geom-abline.R'
136136
'geom-rect.R'
137137
'geom-bar.R'
138+
'geom-tile.R'
138139
'geom-bin2d.R'
139140
'geom-blank.R'
140141
'geom-boxplot.R'
@@ -167,7 +168,6 @@ Collate:
167168
'geom-smooth.R'
168169
'geom-spoke.R'
169170
'geom-text.R'
170-
'geom-tile.R'
171171
'geom-violin.R'
172172
'geom-vline.R'
173173
'ggplot2-package.R'
@@ -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'
@@ -254,6 +255,7 @@ Collate:
254255
'stat-ellipse.R'
255256
'stat-function.R'
256257
'stat-identity.R'
258+
'stat-manual.R'
257259
'stat-qq-line.R'
258260
'stat-qq.R'
259261
'stat-quantilemethods.R'
@@ -262,7 +264,6 @@ Collate:
262264
'stat-smooth-methods.R'
263265
'stat-smooth.R'
264266
'stat-sum.R'
265-
'stat-summary-2d.R'
266267
'stat-summary-bin.R'
267268
'stat-summary-hex.R'
268269
'stat-summary.R'
@@ -273,6 +274,7 @@ Collate:
273274
'theme.R'
274275
'theme-defaults.R'
275276
'theme-current.R'
277+
'theme-sub.R'
276278
'utilities-break.R'
277279
'utilities-grid.R'
278280
'utilities-help.R'

NAMESPACE

Lines changed: 22 additions & 0 deletions
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)
@@ -95,6 +97,7 @@ S3method(makeContext,dotstackGrob)
9597
S3method(merge_element,default)
9698
S3method(merge_element,element)
9799
S3method(merge_element,element_blank)
100+
S3method(merge_element,margin)
98101
S3method(pattern_alpha,GridPattern)
99102
S3method(pattern_alpha,GridTilingPattern)
100103
S3method(pattern_alpha,default)
@@ -173,6 +176,7 @@ export(GeomAbline)
173176
export(GeomAnnotationMap)
174177
export(GeomArea)
175178
export(GeomBar)
179+
export(GeomBin2d)
176180
export(GeomBlank)
177181
export(GeomBoxplot)
178182
export(GeomCol)
@@ -264,6 +268,7 @@ export(StatEcdf)
264268
export(StatEllipse)
265269
export(StatFunction)
266270
export(StatIdentity)
271+
export(StatManual)
267272
export(StatQq)
268273
export(StatQqLine)
269274
export(StatQuantile)
@@ -344,6 +349,8 @@ export(element_blank)
344349
export(element_geom)
345350
export(element_grob)
346351
export(element_line)
352+
export(element_point)
353+
export(element_polygon)
347354
export(element_rect)
348355
export(element_render)
349356
export(element_text)
@@ -494,6 +501,8 @@ export(layer_sf)
494501
export(lims)
495502
export(map_data)
496503
export(margin)
504+
export(margin_auto)
505+
export(margin_part)
497506
export(max_height)
498507
export(max_width)
499508
export(mean_cl_boot)
@@ -689,6 +698,7 @@ export(stat_ecdf)
689698
export(stat_ellipse)
690699
export(stat_function)
691700
export(stat_identity)
701+
export(stat_manual)
692702
export(stat_qq)
693703
export(stat_qq_line)
694704
export(stat_quantile)
@@ -721,7 +731,19 @@ export(theme_linedraw)
721731
export(theme_minimal)
722732
export(theme_replace)
723733
export(theme_set)
734+
export(theme_sub_axis)
735+
export(theme_sub_axis_bottom)
736+
export(theme_sub_axis_left)
737+
export(theme_sub_axis_right)
738+
export(theme_sub_axis_top)
739+
export(theme_sub_axis_x)
740+
export(theme_sub_axis_y)
741+
export(theme_sub_legend)
742+
export(theme_sub_panel)
743+
export(theme_sub_plot)
744+
export(theme_sub_strip)
724745
export(theme_test)
746+
export(theme_transparent)
725747
export(theme_update)
726748
export(theme_void)
727749
export(transform_position)

NEWS.md

Lines changed: 102 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,71 @@
11
# ggplot2 (development version)
22

3+
* New parameters for `geom_label()` (@teunbrand and @steveharoz, #5365):
4+
* The `linewidth` aesthetic is now applied and replaces the `label.size`
5+
argument.
6+
* The `linetype` aesthetic is now applied.
7+
* New `border.colour` argument to set the colour of borders.
8+
* New `text.colour` argument to set the colour of text.
9+
* New `element_point()` and `element_polygon()` that can be given to
10+
`theme(point, polygon)` as an extension point (@teunbrand, #6248).
11+
* Turned off fallback for `size` to `linewidth` translation in
12+
`geom_bar()`/`geom_col()` (#4848).
13+
* `coord_radial()` now displays no axis instead of throwing an error when
14+
a scale has no breaks (@teunbrand, #6271).
15+
* The `fatten` argument has been deprecated in `geom_boxplot()`,
16+
`geom_crossbar()` and `geom_pointrange()` (@teunbrand, #4881).
17+
* Axis labels are now preserved better when using `coord_sf(expand = TRUE)` and
18+
graticule lines are straight but do not meet the edge (@teunbrand, #2985).
19+
* Attempt to boost detail in `coord_polar()` and `coord_radial()` near the
20+
center (@teunbrand, #5023)
21+
* Scale names, guide titles and aesthetic labels can now accept functions
22+
(@teunbrand, #4313)
23+
* Binned scales with zero-width data expand the default limits by 0.1
24+
(@teunbrand, #5066)
25+
* New default `geom_qq_line(geom = "abline")` for better clipping in the
26+
vertical direction. In addition, `slope` and `intercept` are new computed
27+
variables in `stat_qq_line()` (@teunbrand, #6087).
28+
* Position adjustments can now have auxiliary aesthetics (@teunbrand).
29+
* `position_nudge()` gains `nudge_x` and `nudge_y` aesthetics (#3026, #5445).
30+
* `position_dodge()` gains `order` aesthetic (#3022, #3345)
31+
* More stability for vctrs-based palettes (@teunbrand, #6117).
32+
* Fixed regression in `guide_bins(reverse = TRUE)` (@teunbrand, #6183).
33+
* New function family for setting parts of a theme. For example, you can now use
34+
`theme_sub_axis(line, text, ticks, ticks.length, line)` as a substitute for
35+
`theme(axis.line, axis.text, axis.ticks, axis.ticks.length, axis.line)`. This
36+
should allow slightly terser and more organised theme declarations
37+
(@teunbrand, #5301).
38+
* `scale_{x/y}_discrete(continuous.limits)` is a new argument to control the
39+
display range of discrete scales (@teunbrand, #4174, #6259).
40+
* `geom_ribbon()` now appropriately warns about, and removes, missing values
41+
(@teunbrand, #6243).
42+
* `guide_*()` can now accept two inside legend theme elements:
43+
`legend.position.inside` and `legend.justification.inside`, allowing inside
44+
legends to be placed at different positions. Only inside legends with the same
45+
position and justification will be merged (@Yunuuuu, #6210).
46+
* New stat: `stat_manual()` for arbitrary computations (@teunbrand, #3501)
47+
* Reversal of a dimension, typically 'x' or 'y', is now controlled by the
48+
`reverse` argument in `coord_cartesian()`, `coord_fixed()`, `coord_radial()`
49+
and `coord_sf()`. In `coord_radial()`, this replaces the older `direction`
50+
argument (#4021, @teunbrand).
51+
* `coord_radial()` displays minor gridlines now (@teunbrand).
52+
* (internal) `continuous_scale()` and `binned_scale()` sort the `limits`
53+
argument internally (@teunbrand).
54+
* Theme margins can have NA-units to inherit from parent elements. The new
55+
function `margin_part()` has NA-units as default (@teunbrand, #6115)
56+
* New `margin_auto()` specification for theme margins.
57+
* New argument `labs(dictionary)` to label based on variable name rather than
58+
based on aesthetic (@teunbrand, #5178)
59+
* Fixed bug in out-of-bounds binned breaks (@teunbrand, #6054)
60+
* Binned guides now accept expressions as labels (@teunbrand, #6005)
61+
* (internal) `Scale$get_labels()` format expressions as lists.
62+
* In non-orthogonal coordinate systems (`coord_sf()`, `coord_polar()` and
63+
`coord_radial()`), using 'AsIs' variables escape transformation when
64+
both `x` and `y` is an 'AsIs' variable (@teunbrand, #6205).
65+
* The following methods have been deprecated: `fortify.lm()`, `fortify.glht()`,
66+
`fortify.confint.glht()`, `fortify.summary.glht()` and `fortify.cld()`. It
67+
is recommend to use `broom::augment()` and `broom::tidy()` instead
68+
(@teunbrand, #3816).
369
* Custom and raster annotation now respond to scale transformations, and can
470
use AsIs variables for relative placement (@teunbrand based on
571
@yutannihilation's prior work, #3120)
@@ -15,6 +81,13 @@
1581
(@teunbrand, #4320)
1682
* `geom_boxplot()` gains additional arguments to style the colour, linetype and
1783
linewidths of the box, whiskers, median line and staples (@teunbrand, #5126)
84+
* `geom_violin()` gains additional arguments to style the colour, linetype and
85+
linewidths of the quantiles, which replace the now-deprecated `draw_quantiles`
86+
argument (#5912).
87+
* (breaking) `geom_violin(quantiles)` now has actual quantiles based on
88+
the data, rather than inferred quantiles based on the computed density. The
89+
`quantiles` parameter that replaces `draw_quantiles` now belongs to
90+
`stat_ydensity()` instead of `geom_violin()` (@teunbrand, #4120).
1891
* (internal) Using `after_scale()` in the `Geom*$default_aes()` field is now
1992
evaluated in the context of data (@teunbrand, #6135)
2093
* Fixed bug where binned scales wouldn't simultaneously accept transformations
@@ -203,8 +276,36 @@
203276
* The ellipsis argument is now checked in `fortify()`, `get_alt_text()`,
204277
`labs()` and several guides (@teunbrand, #3196).
205278
* `stat_summary_bin()` no longer ignores `width` parameter (@teunbrand, #4647).
206-
* Added `keep.zeroes` argument to `stat_bin()` (@teunbrand, #3449)
279+
* Reintroduced `drop` argument to `stat_bin()` (@teunbrand, #3449)
280+
* (internal) removed barriers for using 2D structures as aesthetics
281+
(@teunbrand, #4189).
207282
* `coord_sf()` no longer errors when dealing with empty graticules (@teunbrand, #6052)
283+
* Added `theme_transparent()` with transparent backgrounds (@topepo).
284+
* New theme elements `palette.{aes}.discrete` and `palette.{aes}.continuous`.
285+
Theme palettes replace palettes in scales where `palette = NULL`, which is
286+
the new default in many scales (@teunbrand, #4696).
287+
* `guide_axis()` no longer reserves space for blank ticks
288+
(@teunbrand, #4722, #6069).
289+
* `geom_abline()` clips to the panel range in the vertical direction too
290+
(@teunbrand, #6086).
291+
* Added `panel.widths` and `panel.heights` to `theme()` (#5338, @teunbrand).
292+
* Standardised the calculation of `width`, which are now implemented as
293+
aesthetics (@teunbrand, #2800).
294+
* Stricter check on `register_theme_elements(element_tree)` (@teunbrand, #6162)
295+
* Added `weight` aesthetic for `stat_ellipse()` (@teunbrand, #5272)
296+
* Fixed a bug where the `guide_custom(order)` wasn't working (@teunbrand, #6195)
297+
* All binning stats now use the `boundary`/`center` parametrisation rather
298+
than `origin`, following in `stat_bin()`'s footsteps (@teunbrand).
299+
* `stat_summary_2d()` and `stat_bin_2d()` now deal with zero-range data
300+
more elegantly (@teunbrand, #6207).
301+
* Munching in `coord_polar()` and `coord_radial()` now adds more detail,
302+
particularly for data-points with a low radius near the center
303+
(@teunbrand, #5023).
304+
* All scales now expose the `aesthetics` parameter (@teunbrand, #5841)
305+
* New `theme(legend.key.justification)` to control the alignment of legend keys
306+
(@teunbrand, #3669).
307+
* Added `scale_{x/y}_time(date_breaks, date_minor_breaks, date_labels)`
308+
(@teunbrand, #4335).
208309

209310
# ggplot2 3.5.1
210311

R/aes.R

Lines changed: 7 additions & 0 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.

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)