diff --git a/DESCRIPTION b/DESCRIPTION index 254a6bcea2..3fd08f2f53 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ggplot2 Title: Create Elegant Data Visualisations Using the Grammar of Graphics -Version: 4.0.0.9000 +Version: 4.0.1.9000 Authors@R: c( person("Hadley", "Wickham", , "hadley@posit.co", role = "aut", comment = c(ORCID = "0000-0003-4757-117X")), diff --git a/NEWS.md b/NEWS.md index f28acdcef4..8666ca36e9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,15 +1,17 @@ # ggplot2 (development version) +# ggplot2 4.0.1 + +This is a smaller patch release focussed on fixing regressions from 4.0.0 and +polishing the recent features. + +## Bug fixes + * Fixed regression where `geom_area()` didn't draw panels with single groups when `stat = "align"` (@teunbrand, #6680) * Fixed regression where `position_stack(vjust)` was ignored when there are only single groups (#6692) * Fixed bug where `NA` handling in `geom_path()` was ignoring panels (@teunbrand, #6533) -* Logical values for the linetype aesthetic will be interpreted numerically, - so that `linetype = FALSE` becomes 0/'blank' and `linetype = TRUE` becomes - 1/'solid' (@teunbrand, #6641) -* Out-of-bounds datapoints used as padding by `stat_align()` now get removed - silently rather than verbosely (@teunbrand, #6667) * Fixed bug where `stat_bin(boundary)` was ignored (#6682). * `geom_text()` and `geom_label()` accept expressions as the `label` aesthetic (@teunbrand, #6638) @@ -17,9 +19,6 @@ (@mitchelloharawild, #6609). * Fixed regression where `scale_{x,y}_*()` threw an error when an expression object is set to `labels` argument (@yutannihilation, #6617). -* Improved palette fallback mechanism in scales (@teunbrand, #6669). -* Allow `stat` in `geom_hline`, `geom_vline`, and `geom_abline`. (@sierrajohnson, #6559) -* `stat_boxplot()` treats `width` as an optional aesthetic (@Yunuuuu, #6575) * Fixed regression where the first (unnamed) argument to colour/fill scales was not passed as the `name` argument (@teunbrand, #6623) * Fixed issue where vectorised `arrow()`s caused errors in drawing the @@ -28,10 +27,21 @@ insistently. Now they contribute only as fallback labels (@teunbrand, #6616) * Fixed regression where empty arguments to colour/fill scale caused errors (@jmbarbone, #6710) +* Fixed axis misplacement in `coor_radial()` when labels are blank (@teunbrand, #6574) + +## Improvements + +* Improved palette fallback mechanism in scales (@teunbrand, #6669). +* Allow `stat` in `geom_hline`, `geom_vline`, and `geom_abline`. (@sierrajohnson, #6559) +* `stat_boxplot()` treats `width` as an optional aesthetic (@Yunuuuu, #6575) * The `theme(panel.widths, panel.heights)` setting attempts to preserve the plot's aspect ratio when only one of the two settings is given, and the plot has a single panel (@teunbrand, #6701). -* Fixed axis misplacement in `coor_radial()` when labels are blank (@teunbrand, #6574) +* Logical values for the linetype aesthetic will be interpreted numerically, + so that `linetype = FALSE` becomes 0/'blank' and `linetype = TRUE` becomes + 1/'solid' (@teunbrand, #6641) +* Out-of-bounds datapoints used as padding by `stat_align()` now get removed + silently rather than verbosely (@teunbrand, #6667) # ggplot2 4.0.0 diff --git a/R/layer.R b/R/layer.R index 179f519441..99ad92a4ff 100644 --- a/R/layer.R +++ b/R/layer.R @@ -972,10 +972,8 @@ normalise_label <- function(label) { return(NULL) } if (obj_is_list(label)) { - # Ensure that each element in the list has length 1 + # Ensure no elements are empty label[lengths(label) == 0] <- "" - truncate <- !vapply(label, is.call, logical(1)) # Don't mess with call/formula - label[truncate] <- lapply(label[truncate], `[`, 1) } if (is.expression(label)) { # Classed expressions, when converted to lists, retain their class. diff --git a/README.Rmd b/README.Rmd index 15c6f2e4d9..888532d741 100644 --- a/README.Rmd +++ b/README.Rmd @@ -76,7 +76,7 @@ If you are new to ggplot2 you are better off starting with a systematic introduc [Communication][r4ds-comm] chapters in [R for Data Science][r4ds]. R for Data Science is designed to give you a comprehensive introduction to the - [tidyverse](https://www.tidyverse.org), and these two chapters will + [tidyverse](https://tidyverse.org/), and these two chapters will get you up to speed with the essentials of ggplot2 as quickly as possible. @@ -119,4 +119,4 @@ There are two main places to get help with ggplot2: [r4ds-vis]: https://r4ds.hadley.nz/data-visualize [r4ds-comm]: https://r4ds.hadley.nz/communication [oreilly]: https://learning.oreilly.com/videos/data-visualization-in/9781491963661/ -[blog]: https://www.tidyverse.org/tags/ggplot2/ +[blog]: https://tidyverse.org/tags/ggplot2/ diff --git a/README.md b/README.md index 10dadaadb5..a415d9c952 100644 --- a/README.md +++ b/README.md @@ -80,8 +80,8 @@ documentation pages. Currently, there are several good places to start: [Communication](https://r4ds.hadley.nz/communication) chapters in [R for Data Science](https://r4ds.hadley.nz). R for Data Science is designed to give you a comprehensive introduction to the - [tidyverse](https://www.tidyverse.org), and these two chapters will - get you up to speed with the essentials of ggplot2 as quickly as + [tidyverse](https://tidyverse.org/), and these two chapters will get + you up to speed with the essentials of ggplot2 as quickly as possible. 2. If you’d like to take an online course, try [Data Visualization in R @@ -105,7 +105,7 @@ documentation pages. Currently, there are several good places to start: graphics specifically tailored to your needs. 6. For articles about announcements and deep-dives you can visit the - [tidyverse blog](https://www.tidyverse.org/tags/ggplot2/). + [tidyverse blog](https://tidyverse.org/tags/ggplot2/). ## Getting help diff --git a/cran-comments.md b/cran-comments.md index f41bd175a0..5c6814249f 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,9 +1,13 @@ -This is a major release of ggplot2. Among other things it includes an adaption -of S7 for all the S3 classes and methods that were currently in use. -Unfortunately such a change is not without issue with the number of reverse -dependencies that ggplot2 has as many packages wrongfully checks the internals -of ggplot2 objects in their tests. +This is a patch release fixing a range of regressions reported after the 4.0.0 +release. While no breaking changes in the API we did detect a few packages that +breaks with this release due to either making assumptions about ggplot2 internal +behaviour, or requiring documentation updates that can only happen after release +of 4.0.1 -Because of this you should expect a larger than usual number of breaking -packages. We have been very diligent to reach out to all maintainers over the -last 2-3 months and provided resolutions but breakages are still to be expected. +The packages are: +- adproplus: https://github.com/henry-heppe/adproclus/issues/3 +- ggsurveillance: https://github.com/biostats-dev/ggsurveillance/issues/1 +- ggformula: https://github.com/ProjectMOSAIC/ggformula/issues/187 +- ggside: https://github.com/jtlandis/ggside/issues/71 + +They have all been notified in advance of this submission diff --git a/vignettes/ggplot2-in-packages.qmd b/vignettes/ggplot2-in-packages.qmd index aa50da9e6e..90000e9d67 100644 --- a/vignettes/ggplot2-in-packages.qmd +++ b/vignettes/ggplot2-in-packages.qmd @@ -246,4 +246,4 @@ Generally, if you add a method for a ggplot2 generic like `autoplot()`, ggplot2 ``` ## Read more -There are other things to consider when taking on a dependency. [This post]( https://www.tidyverse.org/blog/2022/09/playing-on-the-same-team-as-your-dependecy/) goes into detail with many of these using ggplot2 as an example and is a good read for anyone developing a package using ggplot2. +There are other things to consider when taking on a dependency. [This post]( https://tidyverse.org/blog/2022/09/playing-on-the-same-team-as-your-dependecy/) goes into detail with many of these using ggplot2 as an example and is a good read for anyone developing a package using ggplot2.