Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't attempt to calculate secondary breaks = NULL #5714

Merged
merged 3 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
`NA`s (#5623)
* Facet evaluation is better at dealing with inherited errors
(@teunbrand, #5670).
* Fixed spurious warnings from `sec_axis()` with `breaks = NULL` (#5713).

# ggplot2 3.5.0

Expand Down
4 changes: 2 additions & 2 deletions R/axis-secondary.R
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ AxisSecondary <- ggproto("AxisSecondary", NULL,
range_info <- temp_scale$break_info()

# Map the break values back to their correct position on the primary scale
if (!is.null(range_info$major_source)) {
if (length(range_info$major_source) > 0) {
old_val <- stats::approx(full_range, old_range, range_info$major_source)$y
old_val_trans <- transformation$transform(old_val)

Expand All @@ -263,7 +263,7 @@ AxisSecondary <- ggproto("AxisSecondary", NULL,
old_val_trans <- NULL
}

if (!is.null(range_info$minor_source)) {
if (length(range_info$minor_source) > 0) {
old_val_minor <- stats::approx(full_range, old_range, range_info$minor_source)$y
old_val_minor_trans <- transformation$transform(old_val_minor)

Expand Down
Loading