Skip to content

coord_trans/polar() ignore position guides #3959

Closed
@teunbrand

Description

@teunbrand

While I was trying to making a variant of guide_axis() that displays tick marks at minor breaks (see for example SO), I stumbled on a possible bug in coord_trans() and coord_polar(), which appear to ignore position guides.

Standard cartesian coordinates seem to work just fine.

library(ggplot2)

p <- ggplot(mpg, aes(hwy, cty)) +
  geom_point() +
  guides(x = guide_axis("custom axis"))

p + coord_cartesian()

Polar coordinates don't render the correct axis title.

p + coord_polar()

Transformed coordinates also don't render the correct axis title.

p + coord_trans()

Created on 2020-04-22 by the reprex package (v0.3.0)

The same pattern holds if I specify scale_x_continuous(guide = guide_axis("custom axis)) or use guides(x.sec = guide_axis("custom axis")).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions