Skip to content

Conversation

teunbrand
Copy link
Collaborator

This PR replaces #6213 and fixes #6211.

A few mistakes crept into #6070, which this PR rectifies.
Essentially, the reverse parameter is now included into panel parameters and axes can use that to select a good placement for the axis line.

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

p <- ggplot(mpg, aes(displ, hwy)) +
  geom_point() +
  theme(axis.line = element_line())

p + coord_cartesian(reverse = "xy")

For #6211 (comment), the plot is now centered and the title is placed reasonably.

p + coord_radial(
  start = 0.25 * pi, end = 0.75 * pi,
  reverse = "thetar", inner.radius = 0.3
)

Created on 2025-03-27 with reprex v2.1.1

@teunbrand teunbrand mentioned this pull request Mar 27, 2025
@teunbrand teunbrand added this to the ggplot2 4.0.0 milestone May 6, 2025
@thomasp85
Copy link
Member

LGTM

@teunbrand teunbrand merged commit 54d564d into tidyverse:main May 19, 2025
13 checks passed
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.

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

2 participants