Closed
Description
In case a transformation is applied, the geom_hline
function takes the intercept in the initial scale, contrary to the other geoms.
p1 <- ggplot(mpg, aes(displ, hwy)) + geom_point() + scale_y_log10()
The line is created if the intercept is specified in the original (non-transformed) scale in geom_hline
:
p1 + geom_hline(yintercept = 30)
Contrary to the geom_abline
behaviour:
p1 + geom_abline(intercept = log10(30), slope = 0)