Skip to content

Commit 5b58c7c

Browse files
authored
Merge branch 'main' into v3.4.1-rc
2 parents baad4cc + 37d9e8c commit 5b58c7c

19 files changed

+498
-111
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Bug report
3+
about: Submit a bug report to help us improve ggplot2
4+
---
5+
6+
### Tips for a helpful bug report:
7+
8+
* If you have a question, please don't use this form. Instead, ask on <https://stackoverflow.com/> or <https://community.rstudio.com/>.
9+
10+
* Please include a **minimal reproducible example**, a reprex, to demonstrate the bug.
11+
If you've never heard of a reprex, please read ["Make a reprex"](https://www.tidyverse.org/help/#reprex).
12+
Do not include session info unless it is explicitly asked for.
13+
14+
* If you can, use one of the built-in datasets or a small toy dataset that exposes the bug.
15+
If for some reason, the bug only occurs on your original data, try to limit the number of rows that are necessary to expose the bug.
16+
Share such data by copying `dput()` output rather than an external file.
17+
18+
* Unless the bug is about the theme, labels, scales or other plot decoration: please omit these from the code.
19+
20+
* Please check whether somebody has reported the same problem in the [issues](https://github.com/tidyverse/ggplot2/issues).
21+
22+
Delete these instructions once you have read them.
23+
24+
---
25+
26+
I found a problem with ...
27+
28+
I expected ...
29+
30+
Here is the code to reproduce the bug:
31+
32+
```r
33+
# copy your code to the clipboard and run:
34+
reprex::reprex()
35+
```

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
contact_links:
2+
- name: Help or discussion
3+
url: https://community.rstudio.com/
4+
about: "Check out options for getting help on the RStudio Community."
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: "Feature Request"
3+
about: Suggest a change or new feature in ggplot2
4+
---
5+
6+
### Tips for a helpful feature request:
7+
8+
* If you have a question, please don't use this form. Instead, ask on <https://stackoverflow.com/> or <https://community.rstudio.com/>.
9+
10+
* See the [contributing guidelines](https://github.com/tidyverse/ggplot2/blob/main/CONTRIBUTING.md).
11+
12+
* ggplot2 is a mature package that is unlikely to adopt new functionality that can be covered by its extension mechanisms.
13+
Improvements to its current functionality or to infrastructure are considered in scope for feature requests.
14+
15+
* Please motivate the need for change, if applicable with a **minimal reproducible** example (reprex).
16+
If you've never heard of a reprex, please read ["Make a reprex"](https://www.tidyverse.org/help/#reprex).
17+
Do not include session info unless it is explicitly asked for.
18+
19+
Delete this instructions once you've read them.
20+
21+
---
22+
23+
In situations when ...
24+
25+
I would like to be able to ...
26+
27+
```r
28+
# copy your code to the clipboard and run:
29+
reprex::reprex()
30+
```

.github/workflows/R-CMD-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959

6060
- uses: r-lib/actions/setup-r-dependencies@v2
6161
with:
62-
cache-version: 2
62+
cache-version: 3
6363
extra-packages: >
6464
any::rcmdcheck,
6565
Hmisc=?ignore-before-r=3.6.0,

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Config/testthat/edition: 3
8080
Encoding: UTF-8
8181
LazyData: true
8282
Roxygen: list(markdown = TRUE)
83-
RoxygenNote: 7.2.1
83+
RoxygenNote: 7.2.3
8484
Collate:
8585
'ggproto.r'
8686
'ggplot-global.R'

ISSUE_TEMPLATE.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

NAMESPACE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,10 @@ S3method(scale_type,Date)
132132
S3method(scale_type,POSIXt)
133133
S3method(scale_type,character)
134134
S3method(scale_type,default)
135+
S3method(scale_type,double)
135136
S3method(scale_type,factor)
136137
S3method(scale_type,hms)
138+
S3method(scale_type,integer)
137139
S3method(scale_type,list)
138140
S3method(scale_type,logical)
139141
S3method(scale_type,numeric)
@@ -316,6 +318,7 @@ export(coord_trans)
316318
export(cut_interval)
317319
export(cut_number)
318320
export(cut_width)
321+
export(datetime_scale)
319322
export(derive)
320323
export(discrete_scale)
321324
export(draw_key_abline)

NEWS.md

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

3+
* Fixed bug in `coord_sf()` where graticule lines didn't obey
4+
`panel.grid.major`'s linewidth setting (@teunbrand, #5179)
5+
* The `datetime_scale()` scale constructor is now exported for use in extension
6+
packages (@teunbrand, #4701).
7+
* `geom_text()` drops observations where `angle = NA` instead of throwing an
8+
error (@teunbrand, #2757).
9+
* `update_geom_defaults()` and `update_stat_defaults()` now return properly
10+
classed objects and have updated docs (@dkahle, #5146)
11+
312
# ggplot2 3.4.1
413
This is a small release focusing on fixing regressions in the 3.4.0 release
514
and minor polishes.

R/coord-sf.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ CoordSf <- ggproto("CoordSf", CoordCartesian,
305305
} else {
306306
line_gp <- gpar(
307307
col = el$colour,
308-
lwd = len0_null(el$size*.pt),
308+
lwd = len0_null(el$linewidth * .pt),
309309
lty = el$linetype
310310
)
311311
grobs <- c(

R/geom-defaults.r

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,38 @@
77
#' @keywords internal
88
#' @export
99
#' @examples
10-
#' update_geom_defaults("point", list(colour = "darkblue"))
10+
#'
11+
#' # updating a geom's default aesthetic settings
12+
#' # example: change geom_point()'s default color
13+
#' GeomPoint$default_aes
14+
#' update_geom_defaults("point", aes(color = "red"))
15+
#' GeomPoint$default_aes
1116
#' ggplot(mtcars, aes(mpg, wt)) + geom_point()
12-
#' update_geom_defaults("point", list(colour = "black"))
17+
#'
18+
#' # reset default
19+
#' update_geom_defaults("point", aes(color = "black"))
20+
#'
21+
#'
22+
#' # updating a stat's default aesthetic settings
23+
#' # example: change stat_bin()'s default y-axis to the density scale
24+
#' StatBin$default_aes
25+
#' update_stat_defaults("bin", aes(y = after_stat(density)))
26+
#' StatBin$default_aes
27+
#' ggplot(data.frame(x = rnorm(1e3)), aes(x)) +
28+
#' geom_histogram() +
29+
#' geom_function(fun = dnorm, color = "red")
30+
#'
31+
#' # reset default
32+
#' update_stat_defaults("bin", aes(y = after_stat(count)))
33+
#'
1334
#' @rdname update_defaults
1435
update_geom_defaults <- function(geom, new) {
1536
g <- check_subclass(geom, "Geom", env = parent.frame())
1637
old <- g$default_aes
17-
g$default_aes <- defaults(rename_aes(new), old)
38+
new <- rename_aes(new)
39+
new_names_order <- unique(c(names(old), names(new)))
40+
new <- defaults(new, old)[new_names_order]
41+
g$default_aes[names(new)] <- new
1842
invisible()
1943
}
2044

@@ -23,6 +47,9 @@ update_geom_defaults <- function(geom, new) {
2347
update_stat_defaults <- function(stat, new) {
2448
g <- check_subclass(stat, "Stat", env = parent.frame())
2549
old <- g$default_aes
26-
g$default_aes <- defaults(rename_aes(new), old)
50+
new <- rename_aes(new)
51+
new_names_order <- unique(c(names(old), names(new)))
52+
new <- defaults(new, old)[new_names_order]
53+
g$default_aes[names(new)] <- new
2754
invisible()
2855
}

0 commit comments

Comments
 (0)