Bug in geom_hline() with scale_y_log10()

19 views
Skip to first unread message

Roberto

unread,
Sep 4, 2009, 3:36:36 PM9/4/09
to ggplot2
It seems that, when used together with scale_y_log10(), geom_hline()
requires as y intercept the log10 of the y intercept, instead of the y
intercept itself. I don't think this is the desired behavior. It's
certainly not the way that abline(h=...) behaves with plot( ... ,
log="y").

For instance,

da <- data.frame(x=1:2, y=c(1, 10))
qplot(x, y, data=da) +
scale_y_log10() +
geom_hline(yintercept=1, colour="red")

The red line is drawn at y=10 instead of y=1.

Thanks, Hadley, for looking at this and for the reply to my previous
post on faceting scales.

Roberto

hadley wickham

unread,
Sep 4, 2009, 6:06:30 PM9/4/09
to Roberto, ggplot2
Hi Roberto,

Thanks for the bug report - it's on my to do list.

Hadley
--
http://had.co.nz/
Reply all
Reply to author
Forward
0 new messages