11# ggplot2 (development version)
22
3- * ` geom_boxplot() ` /` stat_boxplot() ` gain a ` quantile.type ` parameter (default ` 7 ` )
4- to control the percentile definition used for hinges and median; set ` quantile.type = 2 `
5- to match SAS's default ` PCTLDEF = 5 ` , enabling parity with SAS boxplots out-of-the-box.
3+ * ` geom_boxplot() ` /` stat_boxplot() ` gain a ` quantile.type ` parameter (default ` 7 ` )
4+ to control the percentile definition used for hinges and median; set ` quantile.type = 2 `
5+ to match SAS's default ` PCTLDEF = 5 ` , enabling parity with SAS boxplots out-of-the-box.
66 (@munoztd0 , #6819 )
77* ` make_constructor() ` no longer captures ` rlang::list2() ` at build time.
8- * The ` arrow ` and ` arrow.fill ` arguments are now available in
8+ * The ` arrow ` and ` arrow.fill ` arguments are now available in
99 ` geom_linerange() ` and ` geom_pointrange() ` layers (@teunbrand , #6481 ).
1010* (internal) ` zeroGrob() ` now returns a ` grid::nullGrob() ` (#6390 ).
1111* ` stat_ydensity() ` now only requires the ` x ` or ` y ` aesthetic. The other will
1212 be populated with 0, similar to ` stat_boxplot() ` (@teunbrand , #6600 )
13- * Implemented ` as.list() ` and ` S7::convert() ` methods for lists and classes in ggplot2
13+ * Implemented ` as.list() ` and ` S7::convert() ` methods for lists and classes in ggplot2
1414 (@teunbrand , #6695 )
15- * The default linetype in ` geom_sf() ` is derived from ` geom_polygon() ` for
15+ * The default linetype in ` geom_sf() ` is derived from ` geom_polygon() ` for
1616 polygons and from ` geom_line() ` for (multi)linestrings (@teunbrand , #6543 ).
17- * Using infinite ` radius ` aesthetic in ` geom_spoke() ` now throws a warning
17+ * Using infinite ` radius ` aesthetic in ` geom_spoke() ` now throws a warning
1818 (#6671 )
1919* Scales and guides specified by a string can now use package name prefixes to
2020 indicate a namespace wherein to look for the scale/guide. For example, one can
2121 use ` scale_x_continuous(guide = "legendry::axis_base") ` (@teunbrand , #4705 ).
22- * ` get_layer_data() ` and ` get_layer_grob() ` now accept layer names as index
22+ * ` get_layer_data() ` and ` get_layer_grob() ` now accept layer names as index
2323 (@lgaborini , #6724 )
24- * Added new argument ` geom_curve(shape) ` that will be passed down to
24+ * Added new argument ` geom_curve(shape) ` that will be passed down to
2525 ` grid::curveGrob() ` (@fmarotta , #5998 ).
2626* Fixed a regression where default ` width ` was miscalculated when some panels
2727 are empty (@teunbrand , #6758 )
2828* ` geom_hex() ` has a new ` radius ` aesthetic, representing the relative size of
2929 the hexagons (@teunbrand , #6727 )
3030* Added ` preserve ` argument to ` position_jitterdodge() ` (@teunbrand , #6584 ).
31- * Fixed ` position_jitterdodge(jitter.height, jitter.width) ` applying to the
31+ * Fixed ` position_jitterdodge(jitter.height, jitter.width) ` applying to the
3232 wrong dimension with flipped geoms (@teunbrand , #6535 ).
3333* New ` position_dodge2(group.row) ` argument that can be set to ` "many" ` to
34- dodge groups with more than one row, such as in ` geom_violin() `
34+ dodge groups with more than one row, such as in ` geom_violin() `
3535 (@teunbrand , #6663 )
36+ * ` palette.{aes}.discrete ` and ` palette.{aes}.continuous ` are now documented
37+ in ` theme() ` and have a new helper ` theme_sub_palette() ` .
38+ ` strip.position.x ` and ` strip.position.y ` are also documented and work
39+ with ` theme_sub_strip() ` (@arcresu , #6829 ).
3640
3741# ggplot2 4.0.2
3842
3943This hotfix release makes ggplot2 more interoperable between rlang versions.
4044
4145# ggplot2 4.0.1
4246
43- This is a smaller patch release focussed on fixing regressions from 4.0.0 and
47+ This is a smaller patch release focussed on fixing regressions from 4.0.0 and
4448polishing the recent features.
4549
4650## Bug fixes
4751
48- * Fixed regression where ` geom_area() ` didn't draw panels with single groups
52+ * Fixed regression where ` geom_area() ` didn't draw panels with single groups
4953 when ` stat = "align" ` (@teunbrand , #6680 )
5054* Fixed regression where ` position_stack(vjust) ` was ignored when there are
5155 only single groups (#6692 )
5256* Fixed bug where ` NA ` handling in ` geom_path() ` was ignoring panels (@teunbrand , #6533 )
5357* Fixed bug where ` stat_bin(boundary) ` was ignored (#6682 ).
54- * ` geom_text() ` and ` geom_label() ` accept expressions as the ` label ` aesthetic
58+ * ` geom_text() ` and ` geom_label() ` accept expressions as the ` label ` aesthetic
5559 (@teunbrand , #6638 )
56- * Fixed regression where ` draw_key_rect() ` stopped using ` fill ` colours
60+ * Fixed regression where ` draw_key_rect() ` stopped using ` fill ` colours
5761 (@mitchelloharawild , #6609 ).
5862* Fixed regression where ` scale_{x,y}_*() ` threw an error when an expression
5963 object is set to ` labels ` argument (@yutannihilation , #6617 ).
60- * Fixed regression where the first (unnamed) argument to colour/fill scales was
64+ * Fixed regression where the first (unnamed) argument to colour/fill scales was
6165 not passed as the ` name ` argument (@teunbrand , #6623 )
62- * Fixed issue where vectorised ` arrow() ` s caused errors in drawing the
66+ * Fixed issue where vectorised ` arrow() ` s caused errors in drawing the
6367 legend glyphs (@teunbrand , #6594 )
64- * Fixed regression where ` NULL ` -aesthetics contributed to plot labels too
68+ * Fixed regression where ` NULL ` -aesthetics contributed to plot labels too
6569 insistently. Now they contribute only as fallback labels (@teunbrand , #6616 )
6670* Fixed regression where empty arguments to colour/fill scale caused errors
6771 (@jmbarbone , #6710 )
@@ -73,10 +77,10 @@ polishing the recent features.
7377* Allow ` stat ` in ` geom_hline ` , ` geom_vline ` , and ` geom_abline ` . (@sierrajohnson , #6559 )
7478* ` stat_boxplot() ` treats ` width ` as an optional aesthetic (@Yunuuuu , #6575 )
7579* The ` theme(panel.widths, panel.heights) ` setting attempts to preserve the
76- plot's aspect ratio when only one of the two settings is given, and the plot
80+ plot's aspect ratio when only one of the two settings is given, and the plot
7781 has a single panel (@teunbrand , #6701 ).
7882* Logical values for the linetype aesthetic will be interpreted numerically,
79- so that ` linetype = FALSE ` becomes 0/'blank' and ` linetype = TRUE ` becomes
83+ so that ` linetype = FALSE ` becomes 0/'blank' and ` linetype = TRUE ` becomes
8084 1/'solid' (@teunbrand , #6641 )
8185* Out-of-bounds datapoints used as padding by ` stat_align() ` now get removed
8286 silently rather than verbosely (@teunbrand , #6667 )
@@ -98,15 +102,15 @@ polishing the recent features.
98102 * The ` element_geom() ` function can be used to populate that argument.
99103 * The ` from_theme() ` function allows access to the theme default fields from
100104 inside the ` aes() ` function.
101- * Moved the following packages in the description. If your package depended on
102- ggplot2 to install these dependencies, you may need to list these in your
105+ * Moved the following packages in the description. If your package depended on
106+ ggplot2 to install these dependencies, you may need to list these in your
103107 own DESCRIPTION file now (#5986 ).
104108 * Moved mgcv from Imports to Suggests
105109 * Moved tibble from Imports to Suggests
106110 * Removed glue dependency
107- * Default labels are derived in ` build_ggplot() ` (previously ` ggplot_build() ` )
108- rather than in the layer method of ` update_ggplot() `
109- (previously ` ggplot_add.Layer() ` ). This may affect code that accessed the
111+ * Default labels are derived in ` build_ggplot() ` (previously ` ggplot_build() ` )
112+ rather than in the layer method of ` update_ggplot() `
113+ (previously ` ggplot_add.Layer() ` ). This may affect code that accessed the
110114 ` plot$labels ` property (@teunbrand , #5894 ).
111115* In binning stats, the default ` boundary ` is now chosen to better adhere to
112116 the ` nbin ` argument. This may affect plots that use default binning
@@ -118,7 +122,7 @@ polishing the recent features.
118122 of warnings.
119123* Functions and arguments that were soft-deprecated up to ggplot2 3.4.0 now
120124 throw warnings.
121- * ` annotation_borders() ` replaces the now-deprecated ` borders() `
125+ * ` annotation_borders() ` replaces the now-deprecated ` borders() `
122126 (@teunbrand , #6392 )
123127* Turned off fallback for ` size ` to ` linewidth ` translation in
124128 ` geom_bar() ` /` geom_col() ` (#4848 ).
@@ -144,28 +148,28 @@ polishing the recent features.
144148 | ` get_layer_data() ` | ` layer_data() ` |
145149 | ` get_layer_grob() ` | ` layer_grob() ` |
146150 | ` get_panel_scales() ` | ` layer_scales() ` |
147-
151+
148152* ` facet_wrap() ` has new options for the ` dir ` argument for additional control
149- over panel directions. They absorb interactions with the now-deprecated
153+ over panel directions. They absorb interactions with the now-deprecated
150154 ` as.table ` argument. Internally ` dir = "h" ` or ` dir = "v" ` is deprecated
151155 (@teunbrand , #5212 ).
152156* ` coord_trans() ` was renamed to ` coord_transform() ` (@nmercadeb , #5825 ).
153-
157+
154158### Improvements
155159
156160#### Themes
157161
158162* The ` theme() ` function offers new arguments:
159163 * ` geom ` to set defaults for layer aesthetics (#2239 ).
160- * ` spacing ` /` margins ` as root elements that are inherited by all other
164+ * ` spacing ` /` margins ` as root elements that are inherited by all other
161165 spacings and (non-text) margins (@teunbrand , #5622 ).
162166 * ` palette.{aes}.discrete ` and ` palette.{aes}.continuous ` which determine
163167 the palettes used when scales have ` palette = NULL ` . This is the new
164- default for generic scales like ` scale_colour_discrete() ` or
168+ default for generic scales like ` scale_colour_discrete() ` or
165169 ` scale_fill_continuous() ` , see also the 'Scales' section (#4696 ).
166170 * ` panel.widths ` and ` panel.heights ` to control the (absolute) size of the
167171 panels (#5338 , @teunbrand ).
168- * ` legend.key.justification ` to control the alignment of legend keys
172+ * ` legend.key.justification ` to control the alignment of legend keys
169173 (@teunbrand , #3669 )
170174* Built-in ` theme_*() ` functions have new arguments:
171175 * ` ink ` /` paper ` /` accent ` to control foreground, background and highlight
@@ -193,39 +197,39 @@ polishing the recent features.
193197 * Axis line ends are now ` "square" ` .
194198 * The panel grid is now blank at the ` panel.grid ` hierarchy level instead of
195199 the ` panel.grid.major ` and ` panel.grid.minor ` levels.
196- * The ` theme(legend.spacing.{x/y}) ` setting now accepts ` null ` -units
200+ * The ` theme(legend.spacing.{x/y}) ` setting now accepts ` null ` -units
197201 (@teunbrand , #6417 ).
198202
199203#### Scales
200204
201- * The default colour and fill scales have a new ` palette ` argument. The default,
205+ * The default colour and fill scales have a new ` palette ` argument. The default,
202206 ` palette = NULL ` will retrieve palettes from the theme (see the Themes section).
203- This replaces the old options-based ` type ` system, with some limited backward
207+ This replaces the old options-based ` type ` system, with some limited backward
204208 compatibility (@teunbrand , #6064 ).
205209* All scales now expose the ` aesthetics ` parameter (@teunbrand , #5841 )
206210* All position scales now use the same definition of ` x ` and ` y ` aesthetics.
207211 This lets uncommon aesthetics like ` xintercept ` expand scales as usual.
208212 (#3342 , #4966 , @teunbrand )
209- * In continuous scales, when ` breaks ` is a function and ` n.breaks ` is set, the
210- ` n.breaks ` will be passed to the ` breaks ` function. Previously, ` n.breaks `
213+ * In continuous scales, when ` breaks ` is a function and ` n.breaks ` is set, the
214+ ` n.breaks ` will be passed to the ` breaks ` function. Previously, ` n.breaks `
211215 only applied to the default break calculation (@teunbrand , #5972 ).
212216* Changes in discrete scales:
213- * Added ` palette ` argument, which can be used to customise spacings between
217+ * Added ` palette ` argument, which can be used to customise spacings between
214218 levels (@teunbrand , #5770 )
215219 * Added ` continuous.limits ` argument to control the display range
216220 (@teunbrand , #4174 , #6259 ).
217221 * Added ` minor_breaks ` argument. This only makes sense in position scales,
218222 where it affects the placement of minor ticks and minor gridlines (#5434 ).
219223 * Added ` sec.axis ` argument. Discrete scales don't support transformations
220224 so it is recommended to use ` dup_axis() ` to set custom breaks or labels.
221- Secondary discrete axes work with the continuous analogues of discrete
225+ Secondary discrete axes work with the continuous analogues of discrete
222226 breaks (@teunbrand , #3171 )
223227 * When ` breaks ` yields a named vector, the names will be used as ` labels `
224228 by default (@teunbrand , #6147 ).
225229* Changes in date/time scales:
226- * <POSIXct > is silently cast to <Date > in date scales. Vice versa, <Date >
230+ * <POSIXct > is silently cast to <Date > in date scales. Vice versa, <Date >
227231 is cast to <POSIXct > in datetime scales (@laurabrianna , #3533 )
228- * Bare numeric provided to date or datetime scales get inversely transformed
232+ * Bare numeric provided to date or datetime scales get inversely transformed
229233 (i.e. cast to <Date >/<POSIXct >) with a warning (@teunbrand )
230234 * The ` date_breaks ` , ` date_minor_breaks ` and ` date_labels ` arguments have
231235 been copied over to ` scale_{x/y}_time() ` (@teunbrand , #4335 ).
@@ -241,8 +245,8 @@ polishing the recent features.
241245 argument (#4021 , @teunbrand ).
242246* ` coord_*(expand) ` can now take a logical vector to control expansion at any
243247 side of the panel (top, right, bottom, left) (@teunbrand , #6020 )
244- * New ` coord_cartesian(ratio) ` argument that absorbs the aspect ratio
245- functionality from ` coord_equal() ` and ` coord_fixed() ` , which are now
248+ * New ` coord_cartesian(ratio) ` argument that absorbs the aspect ratio
249+ functionality from ` coord_equal() ` and ` coord_fixed() ` , which are now
246250 wrappers for ` coord_cartesian() ` .
247251* In non-orthogonal coordinate systems (` coord_sf() ` , ` coord_polar() ` and
248252 ` coord_radial() ` ), using 'AsIs' variables escape transformation when
@@ -354,7 +358,7 @@ polishing the recent features.
354358 instead of just rendering the axis line (@teunbrand , #5816 ).
355359* Better handling of the ` guide_axis_logticks(negative.small) ` parameter when
356360 scale limits have small maximum (@teunbrand , #6121 ).
357- * Fixed regression in ` guide_bins(reverse = TRUE) ` (@teunbrand , #6183 ).
361+ * Fixed regression in ` guide_bins(reverse = TRUE) ` (@teunbrand , #6183 ).
358362* Binned guides now accept expressions as labels (@teunbrand , #6005 )
359363* Fixed bug where binned scales wouldn't simultaneously accept transformations
360364 and function-limits (@teunbrand , #6144 ).
@@ -368,12 +372,12 @@ polishing the recent features.
368372* Secondary axes respect ` n.breaks ` setting in continuous scales (@teunbrand , #4483 ).
369373* The size of the ` draw_key_polygon() ` glyph now reflects the ` linewidth `
370374 aesthetic which internally defaults to 0 (#4852 ).
371- * ` draw_key_rect() ` replaces a ` NA ` fill by the ` colour ` aesthetic
375+ * ` draw_key_rect() ` replaces a ` NA ` fill by the ` colour ` aesthetic
372376 (@teunbrand , #5385 , #5756 ).
373377* Fixed bug where ` na.value ` was incorrectly mapped to non-` NA ` values
374378 (@teunbrand , #5756 ).
375379* Missing values from discrete palettes are no longer inappropriately translated
376- (@teunbrand , #5929 ).
380+ (@teunbrand , #5929 ).
377381* Fixed bug where empty discrete scales weren't recognised as such
378382 (@teunbrand , #5945 ).
379383* Fixed regression with incorrectly drawn gridlines when using ` coord_flip() `
@@ -426,7 +430,7 @@ polishing the recent features.
426430 (@teunbrand , #1864 ).
427431* Prevented ` facet_wrap(..., drop = FALSE) ` from throwing spurious errors when
428432 a character facetting variable contained ` NA ` s (@teunbrand , #5485 ).
429-
433+
430434## Developer facing
431435
432436### Utilities
@@ -450,7 +454,7 @@ polishing the recent features.
450454* New function ` get_strip_labels() ` to retrieve facet labels (@teunbrand , #4979 )
451455* The ViewScale class has a ` make_fixed_copy() ` method to permit
452456 copying trained position scales (#3441 ).
453-
457+
454458### Internal changes
455459
456460* Facet gains a new method ` setup_panel_params ` to interact with the
@@ -461,15 +465,15 @@ polishing the recent features.
461465* Using ` after_scale() ` in the ` Geom*$default_aes ` field is now
462466 evaluated in the context of data (@teunbrand , #6135 )
463467* Improvements to ` pal_qualitative() ` (@teunbrand , #5013 )
464- * Panel clipping responsibility moved from Facet class to Coord class through
468+ * Panel clipping responsibility moved from Facet class to Coord class through
465469 new ` Coord$draw_panel() ` method.
466470* Rearranged the code of ` Facet$draw_panels() ` method (@teunbrand ).
467471* Added ` gg ` class to ` labs() ` (@phispu , #5553 ).
468- * The plot's layout now has a coord parameter that is used to prevent setting
472+ * The plot's layout now has a coord parameter that is used to prevent setting
469473 up identical panel parameters more than once (#5427 )
470- * Applying defaults in ` geom_sf() ` has moved from the internal ` sf_grob() ` to
474+ * Applying defaults in ` geom_sf() ` has moved from the internal ` sf_grob() ` to
471475 ` GeomSf$use_defaults() ` (@teunbrand ).
472- * New ` Facet$draw_panel_content() ` method for delegating panel
476+ * New ` Facet$draw_panel_content() ` method for delegating panel
473477 assembly (@Yunuuuu , #6406 ).
474478* Layer data can be attenuated with parameter attributes (@teunbrand , #3175 ).
475479* When facets coerce the faceting variables to factors, the 'ordered' class
@@ -478,15 +482,15 @@ polishing the recent features.
478482 alignment is not necessary (#5788 ).
479483* ` position_stack() ` skips computation when all ` x ` values are unique and
480484 therefore stacking is not necessary (#5788 ).
481- * The summary function of ` stat_summary() ` and ` stat_summary_bin() ` is setup
485+ * The summary function of ` stat_summary() ` and ` stat_summary_bin() ` is setup
482486 once in total instead of once per group (@teunbrand , #5971 )
483487* Removed barriers for using 2D structures as aesthetics (@teunbrand , #4189 ).
484488* Stricter check on ` register_theme_elements(element_tree) ` (@teunbrand , #6162 )
485489* The ` legend.key.width ` and ` legend.key.height ` calculations are no
486490 longer precomputed before guides are drawn (@teunbrand , #6339 )
487491* When ` validate_subclass() ` fails to find a class directly, it tries
488492 to retrieve the class via constructor functions (@teunbrand ).
489-
493+
490494# ggplot2 3.5.2
491495
492496This is a small release focusing on providing infrastructure for other packages
0 commit comments