Skip to content

Commit 05955bf

Browse files
authored
Merge branch 'main' into absorb_coord_fixed
2 parents 2b8029e + 8c86d97 commit 05955bf

File tree

113 files changed

+941
-889
lines changed

Some content is hidden

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

113 files changed

+941
-889
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: 5 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)

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: 1 addition & 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)

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
* New `coord_cartesian(ratio)` argument that absorbs the aspect ratio
44
functionality from `coord_equal()` and `coord_fixed()`, which are now
55
wrappers for `coord_cartesian()`.
6+
* Better handling of the `guide_axis_logticks(negative.small)` parameter when
7+
scale limits have small maximum (@teunbrand, #6121).
8+
* Fixed bug where the `ggplot2::`-prefix did not work with `stage()`
9+
* New roxygen tag `@aesthetics` that takes a Geom, Stat or Position class and
10+
generates an 'Aesthetics' section.
611
* `annotation_borders()` replaces the now-deprecated `borders()`
712
(@teunbrand, #6392)
813
* New `make_constructor()` function that builds a standard constructor for

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

R/coord-polar.R

Lines changed: 2 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,9 @@
1-
#' Polar coordinates
2-
#'
3-
#' The polar coordinate system is most commonly used for pie charts, which
4-
#' are a stacked bar chart in polar coordinates. `coord_radial()` has extended
5-
#' options.
6-
#'
7-
#' @param theta variable to map angle to (`x` or `y`)
8-
#' @param start Offset of starting point from 12 o'clock in radians. Offset
9-
#' is applied clockwise or anticlockwise depending on value of `direction`.
10-
#' @param direction 1, clockwise; -1, anticlockwise
11-
#' @param clip Should drawing be clipped to the extent of the plot panel? A
12-
#' setting of `"on"` (the default) means yes, and a setting of `"off"`
13-
#' means no. For details, please see [`coord_cartesian()`].
1+
#' @rdname coord_radial
142
#' @export
15-
#' @seealso
16-
#' The `r link_book("polar coordinates section", "coord#polar-coordinates-with-coord_polar")`
17-
#' @examples
18-
#' # NOTE: Use these plots with caution - polar coordinates has
19-
#' # major perceptual problems. The main point of these examples is
20-
#' # to demonstrate how these common plots can be described in the
21-
#' # grammar. Use with EXTREME caution.
22-
#'
23-
#' # A pie chart = stacked bar chart + polar coordinates
24-
#' pie <- ggplot(mtcars, aes(x = factor(1), fill = factor(cyl))) +
25-
#' geom_bar(width = 1)
26-
#' pie + coord_polar(theta = "y")
27-
#'
28-
#' \donttest{
29-
#'
30-
#' # A coxcomb plot = bar chart + polar coordinates
31-
#' cxc <- ggplot(mtcars, aes(x = factor(cyl))) +
32-
#' geom_bar(width = 1, colour = "black")
33-
#' cxc + coord_polar()
34-
#' # A new type of plot?
35-
#' cxc + coord_polar(theta = "y")
36-
#'
37-
#' # The bullseye chart
38-
#' pie + coord_polar()
39-
#'
40-
#' # Hadley's favourite pie chart
41-
#' df <- data.frame(
42-
#' variable = c("does not resemble", "resembles"),
43-
#' value = c(20, 80)
44-
#' )
45-
#' ggplot(df, aes(x = "", y = value, fill = variable)) +
46-
#' geom_col(width = 1) +
47-
#' scale_fill_manual(values = c("red", "yellow")) +
48-
#' coord_polar("y", start = pi / 3) +
49-
#' labs(title = "Pac man")
50-
#'
51-
#' # Windrose + doughnut plot
52-
#' if (require("ggplot2movies")) {
53-
#' movies$rrating <- cut_interval(movies$rating, length = 1)
54-
#' movies$budgetq <- cut_number(movies$budget, 4)
55-
#'
56-
#' doh <- ggplot(movies, aes(x = rrating, fill = budgetq))
57-
#'
58-
#' # Wind rose
59-
#' doh + geom_bar(width = 1) + coord_polar()
60-
#' # Race track plot
61-
#' doh + geom_bar(width = 0.9, position = "fill") + coord_polar(theta = "y")
62-
#' }
63-
#' }
643
coord_polar <- function(theta = "x", start = 0, direction = 1, clip = "on") {
654
theta <- arg_match0(theta, c("x", "y"))
665
r <- if (theta == "x") "y" else "x"
6+
lifecycle::signal_stage("superseded", "coord_polar()", "coord_radial()")
677

688
ggproto(NULL, CoordPolar,
699
theta = theta,

0 commit comments

Comments
 (0)