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

coord_cartesian(reverse = ...) changes the alignment of the opposite axis line #6211

Open
davidhodge931 opened this issue Dec 3, 2024 · 2 comments · May be fixed by #6213
Open

coord_cartesian(reverse = ...) changes the alignment of the opposite axis line #6211

davidhodge931 opened this issue Dec 3, 2024 · 2 comments · May be fixed by #6213
Labels
bug an unexpected problem or unintended behavior

Comments

@davidhodge931
Copy link

davidhodge931 commented Dec 3, 2024

library(tidyverse)
library(palmerpenguins)

penguins |> 
  ggplot() +
  geom_point(aes(x = flipper_length_mm, y = body_mass_g)) +
  theme_classic() +
  coord_cartesian(reverse = "x")
#> Warning: Removed 2 rows containing missing values or values outside the scale range
#> (`geom_point()`).

penguins |> 
  ggplot() +
  geom_point(aes(x = flipper_length_mm, y = body_mass_g)) +
  theme_classic() +
  coord_cartesian(reverse = "y")
#> Warning: Removed 2 rows containing missing values or values outside the scale range
#> (`geom_point()`).

penguins |> 
  ggplot() +
  geom_point(aes(x = flipper_length_mm, y = body_mass_g)) +
  theme_classic() +
  coord_cartesian(reverse = "xy")
#> Warning: Removed 2 rows containing missing values or values outside the scale range
#> (`geom_point()`).

Created on 2024-12-04 with reprex v2.1.1

@davidhodge931 davidhodge931 changed the title coord_cartesian(reverse = ...) changes the positioning of the opposite axis line coord_cartesian(reverse = ...) changes the positioning of the opposite axis line Dec 3, 2024
@davidhodge931 davidhodge931 changed the title coord_cartesian(reverse = ...) changes the positioning of the opposite axis line coord_cartesian(reverse = ...) changes the alignment of the opposite axis line Dec 3, 2024
@teunbrand
Copy link
Collaborator

Yeah this seems like a clear regression to me. Thanks for the report David!

@teunbrand
Copy link
Collaborator

Not technically the same issue, but very much related to the PR that introduced the reversals: coord_radial(reverse = "r") misplaces title and un-centers the plot.

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

ggplot(mpg, aes(displ, hwy)) +
  geom_point() +
  theme(axis.line = element_line()) +
  coord_radial(
    start = 0.25 * pi, end = 0.75 * pi,
    reverse = "thetar", inner.radius = 0.3
  )

Created on 2024-12-04 with reprex v2.1.1

@teunbrand teunbrand linked a pull request Dec 4, 2024 that will close this issue
@teunbrand teunbrand added the bug an unexpected problem or unintended behavior label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants