Skip to content

geom_curve curvature direction is inconsistent on flipped axes #5069

Closed
@Torvaney

Description

@Torvaney

The direction of the curvature in geom_curve is inconsistent with respect to other plot elements. This is easy to work around, but it would be nice if it were consistent.

See the following examples:

library(ggplot2)

p <- 
  ggplot(mtcars, aes(x = drat, y = mpg)) +
  geom_point() +
  annotate("curve", x = 4.5, xend = 4.5, y = 20, yend = 15, curvature = -1)

p + ggtitle("In the base plot, the curve arcs away from the points...")

p + coord_flip() + 
  ggtitle("Flipped, the curve arcs *towards* from the points...")

p + coord_flip() + scale_y_reverse()+ 
  ggtitle("Flipped reversed, the curve arcs away from the points again!")

Created on 2022-11-30 with reprex v2.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorlayers 📈

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions