Skip to content

make sure using the prepared r_axis_inside for all methods #6412

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Yunuuuu
Copy link
Contributor

@Yunuuuu Yunuuuu commented Apr 9, 2025

fix #6411

@Yunuuuu
Copy link
Contributor Author

Yunuuuu commented Apr 9, 2025

All other methods that use r_axis_inside already have access to panel_params, so the straightforward fix is to store r_axis_inside inside panel_params

@Yunuuuu
Copy link
Contributor Author

Yunuuuu commented Apr 10, 2025

How about this? It should produce consistent behavior across repeated calls and will only warning once for multiple panels:

library(ggplot2)
my_warn_coord <- coord_radial(start = 0.1 * pi, end = 0.4 * pi, r.axis.inside = FALSE)

# first run
ggplot(mtcars, aes(disp, mpg)) +
  geom_point() +
  my_warn_coord

# second run
ggplot(mtcars, aes(disp, mpg)) +
  geom_point() +
  my_warn_coord

@teunbrand
Copy link
Collaborator

I'm not convinced there should be a panel_params$r_axis_inside parameter. It is a global property that is not needed for calculating panel transformations, so it doesn't belong in the panel parameters in my opinion.

@Yunuuuu
Copy link
Contributor Author

Yunuuuu commented Apr 10, 2025

Thanks for the explanation — I'll keep it out of panel_params as suggested.

@Yunuuuu
Copy link
Contributor Author

Yunuuuu commented Apr 10, 2025

Can I change the warning message to indicate we have set r.axis.inside = TRUE directly

@teunbrand
Copy link
Collaborator

If you think that makes things clearer

Copy link
Collaborator

@teunbrand teunbrand left a comment

Choose a reason for hiding this comment

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

Great, thank you this PR and for following along with all the nitpicks! I think this PR is good to go, but we're figuring out some issues with the current main branch. After those are resolved, I think this can be merged in.

@Yunuuuu
Copy link
Contributor Author

Yunuuuu commented Apr 10, 2025

Appreciate the review and all the guidance—thanks!

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.

wrong r_axis_inside used in coord_radial
2 participants