Skip to content

Flip radius axis in coord_radial() when position = "right"/"top" #5748

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

Merged
merged 5 commits into from
Apr 2, 2024

Conversation

teunbrand
Copy link
Collaborator

This PR aims to fix #5735.

Briefly, when the scale's position argument is set to a secondary position (right/top), the radius axis will be swapped with the secondary radius axis (which is typically a 'none' guide).

A demo:

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

p <- ggplot(mpg) +
  geom_boxplot(aes(x = class, y = displ)) +
  scale_y_continuous(position = "right")

p + coord_radial()

p + coord_radial(r_axis_inside = TRUE)

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

@teunbrand teunbrand added this to the ggplot2 3.5.1 milestone Mar 21, 2024
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 ac19272 into tidyverse:main Apr 2, 2024
@teunbrand teunbrand deleted the coord_radius_flip branch April 2, 2024 08:23
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.

Could the x and y axis position move when coord_radial is used?
2 participants