Closed
Description
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"))
.