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

n.breaks propagate to sec.axis #5973

Merged
merged 4 commits into from
Aug 26, 2024
Merged

Conversation

teunbrand
Copy link
Collaborator

@teunbrand teunbrand commented Jul 3, 2024

This PR aims to fix #4483.

Briefly, it captures n.breaks in a closure when copying the default breaks from a primary scale during secondary scale initialisation.

Reprex from issue:

devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2

dat <- data.frame(x = 1:10, y = sample(x = 1:1000, size = 50, replace = TRUE)) 

ggplot(data = dat, aes(x = x, y = y)) +
  geom_point() +
  scale_y_continuous(
    n.breaks = 20,
    sec.axis = sec_axis(~.)
  )

Created on 2024-07-03 with reprex v2.1.0

Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@teunbrand teunbrand merged commit 332a8ea into tidyverse:main Aug 26, 2024
12 checks passed
@teunbrand teunbrand deleted the secondary_n_breaks branch August 26, 2024 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

n.breaks for sec_axis
2 participants