Skip to content

Commit 0c7425b

Browse files
authored
Merge branch 'main' into relative_legend_spacing
2 parents 4ac627a + 109d049 commit 0c7425b

File tree

138 files changed

+1293
-1019
lines changed

Some content is hidden

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

138 files changed

+1293
-1019
lines changed

.github/workflows/test-coverage.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,16 @@ jobs:
3535
clean = FALSE,
3636
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
3737
)
38+
print(cov)
3839
covr::to_cobertura(cov)
3940
shell: Rscript {0}
4041

41-
- uses: codecov/codecov-action@v4
42+
- uses: codecov/codecov-action@v5
4243
with:
43-
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
44-
file: ./cobertura.xml
45-
plugin: noop
44+
# Fail if error if not on PR, or if on PR and token is given
45+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
46+
files: ./cobertura.xml
47+
plugins: noop
4648
disable_search: true
4749
token: ${{ secrets.CODECOV_TOKEN }}
4850

DESCRIPTION

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ Authors@R: c(
2020
comment = c(ORCID = "0000-0002-9415-4582")),
2121
person("Teun", "van den Brand", role = "aut",
2222
comment = c(ORCID = "0000-0002-9335-7468")),
23-
person("Posit, PBC", role = c("cph", "fnd"))
23+
person("Posit, PBC", role = c("cph", "fnd"),
24+
comment = c(ROR = "03wc8by49"))
2425
)
2526
Description: A system for 'declaratively' creating graphics, based on "The
2627
Grammar of Graphics". You provide the data, tell 'ggplot2' how to map
@@ -30,7 +31,7 @@ License: MIT + file LICENSE
3031
URL: https://ggplot2.tidyverse.org, https://github.com/tidyverse/ggplot2
3132
BugReports: https://github.com/tidyverse/ggplot2/issues
3233
Depends:
33-
R (>= 4.0)
34+
R (>= 4.1)
3435
Imports:
3536
cli,
3637
grDevices,
@@ -63,6 +64,7 @@ Suggests:
6364
ragg (>= 1.2.6),
6465
RColorBrewer,
6566
rmarkdown,
67+
roxygen2,
6668
rpart,
6769
sf (>= 0.7-3),
6870
svglite (>= 2.1.2),
@@ -76,7 +78,7 @@ VignetteBuilder:
7678
knitr
7779
Config/Needs/website: ggtext, tidyr, forcats, tidyverse/tidytemplate
7880
Config/testthat/edition: 3
79-
Config/usethis/last-upkeep: 2024-10-24
81+
Config/usethis/last-upkeep: 2025-04-23
8082
Encoding: UTF-8
8183
LazyData: true
8284
Roxygen: list(markdown = TRUE)
@@ -93,6 +95,7 @@ Collate:
9395
'compat-plyr.R'
9496
'utilities.R'
9597
'aes.R'
98+
'annotation-borders.R'
9699
'utilities-checks.R'
97100
'legend-draw.R'
98101
'geom-.R'

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
YEAR: 2024
1+
YEAR: 2025
22
COPYRIGHT HOLDER: ggplot2 core developer team

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT License
22

3-
Copyright (c) 2024 ggplot2 core developer team
3+
Copyright (c) 2025 ggplot2 core developer team
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

NAMESPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ S3method(element_grob,element_rect)
2828
S3method(element_grob,element_text)
2929
S3method(format,ggproto)
3030
S3method(format,ggproto_method)
31+
S3method(format,rd_section_aesthetics)
3132
S3method(fortify,"NULL")
3233
S3method(fortify,"function")
3334
S3method(fortify,Line)
@@ -297,6 +298,7 @@ export(after_scale)
297298
export(after_stat)
298299
export(alpha)
299300
export(annotate)
301+
export(annotation_borders)
300302
export(annotation_custom)
301303
export(annotation_logticks)
302304
export(annotation_map)

NEWS.md

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

3-
* The `theme(legend.spacing.{x/y})` setting now accepts `null`-units
4-
(@teunbrand, #6417).
3+
* New roxygen tag `@aesthetics` that takes a Geom, Stat or Position class and
4+
generates an 'Aesthetics' section.
5+
* `annotation_borders()` replaces the now-deprecated `borders()`
6+
(@teunbrand, #6392)
57
* New `make_constructor()` function that builds a standard constructor for
68
Geom and Stat classes (@teunbrand, #6142).
79
* In continuous scales, when `breaks` is a function and `n.breaks` is set, the
@@ -348,6 +350,8 @@
348350
(@teunbrand, #6269).
349351
* The default colour and fill scales have a new `palette` argument
350352
(@teunbrand, #6064).
353+
* The `theme(legend.spacing.{x/y})` setting now accepts `null`-units
354+
(@teunbrand, #6417).
351355

352356
# ggplot2 3.5.2
353357

R/annotation-borders.R

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#' Create a layer of map borders
2+
#'
3+
#' This is a quick and dirty way to get map data (from the \pkg{maps} package)
4+
#' onto your plot. This is a good place to start if you need some crude
5+
#' reference lines, but you'll typically want something more sophisticated
6+
#' for communication graphics.
7+
#'
8+
#' @param database map data, see [maps::map()] for details
9+
#' @param regions map region
10+
#' @param fill fill colour
11+
#' @param colour border colour
12+
#' @param xlim,ylim latitudinal and longitudinal ranges for extracting map
13+
#' polygons, see [maps::map()] for details.
14+
#' @inheritDotParams geom_polygon
15+
#' @export
16+
#' @examples
17+
#' if (require("maps")) {
18+
#' data(us.cities)
19+
#' capitals <- subset(us.cities, capital == 2)
20+
#' ggplot(capitals, aes(long, lat)) +
21+
#' annotation_borders("state") +
22+
#' geom_point(aes(size = pop)) +
23+
#' scale_size_area() +
24+
#' coord_quickmap()
25+
#' }
26+
#'
27+
#' if (require("maps")) {
28+
#' # Same map, with some world context
29+
#' ggplot(capitals, aes(long, lat)) +
30+
#' annotation_borders("world", xlim = c(-130, -60), ylim = c(20, 50)) +
31+
#' geom_point(aes(size = pop)) +
32+
#' scale_size_area() +
33+
#' coord_quickmap()
34+
#' }
35+
annotation_borders <- function(database = "world", regions = ".", fill = NA,
36+
colour = "grey50", xlim = NULL, ylim = NULL, ...) {
37+
df <- map_data(database, regions, xlim = xlim, ylim = ylim)
38+
annotate(
39+
geom = "polygon",
40+
x = df$long, y = df$lat, group = df$group,
41+
fill = fill, colour = colour, ...
42+
)
43+
}
44+
45+
#' @export
46+
#' @rdname annotation_borders
47+
#' @usage borders(...) # Deprecated
48+
borders <- function(...) {
49+
deprecate_soft0("4.0.0", "borders()", "annotation_borders()")
50+
annotation_borders(...)
51+
}

R/annotation-logticks.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@
4343
#' a <- ggplot(msleep, aes(bodywt, brainwt)) +
4444
#' geom_point(na.rm = TRUE) +
4545
#' scale_x_log10(
46-
#' breaks = scales::trans_breaks("log10", function(x) 10^x),
46+
#' breaks = scales::trans_breaks("log10", \(x) 10^x),
4747
#' labels = scales::trans_format("log10", scales::math_format(10^.x))
4848
#' ) +
4949
#' scale_y_log10(
50-
#' breaks = scales::trans_breaks("log10", function(x) 10^x),
50+
#' breaks = scales::trans_breaks("log10", \(x) 10^x),
5151
#' labels = scales::trans_format("log10", scales::math_format(10^.x))
5252
#' ) +
5353
#' theme_bw()
@@ -93,6 +93,8 @@ annotation_logticks <- function(base = 10, sides = "bl", outside = FALSE, scaled
9393
if (!is.null(color))
9494
colour <- color
9595

96+
lifecycle::signal_stage("superseded", "annotation_logticks()", "guide_axis_logticks()")
97+
9698
if (lifecycle::is_present(size)) {
9799
deprecate_soft0("3.5.0", I("Using the `size` aesthetic in this geom"), I("`linewidth`"))
98100
linewidth <- linewidth %||% size

R/coord-flip.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
#' geom_area() +
5858
#' coord_flip()
5959
coord_flip <- function(xlim = NULL, ylim = NULL, expand = TRUE, clip = "on") {
60+
lifecycle::signal_stage("superseded", "coord_flip()")
6061
check_coord_limits(xlim)
6162
check_coord_limits(ylim)
6263
ggproto(NULL, CoordFlip,

R/coord-map.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ coord_map <- function(projection="mercator", ..., parameters = NULL, orientation
136136
} else {
137137
params <- parameters
138138
}
139-
139+
lifecycle::signal_stage("superseded", "coord_map()", "coord_sf()")
140140
check_coord_limits(xlim)
141141
check_coord_limits(ylim)
142142

0 commit comments

Comments
 (0)