Description
When a geom
queries the coordinate range and uses the result to create data that is then plotted by another geom
, there is potentially a double transformation. i.e. coord.range()
yields results in coordinate space and if followed by coord.transform()
, the data may get transformed two times. Affects coords
that transform the limits in coord$setup_panel_params
and also do transforms in coord$transform
. This includes coord_trans
and coord_sf
.
Affected geoms include geom_abline
, geom_hline
and geom_hline
.
reprex
library(ggplot2)
df <- data.frame(x=1:6, y=10^(1:6))
ggplot(df, aes(x, y)) +
geom_point() +
geom_vline(xintercept=3, color='red') +
coord_trans(y='log10')
The red line (at x=3) should be top to bottom.