coord_equal throws off geom_vline and geom_hline intercepts

8 views
Skip to first unread message

Joe

unread,
Jan 19, 2010, 4:41:03 PM1/19/10
to ggplot2
Adding coord_equal to a plot throws off the intercepts of geom_vline
and geom_hline.

qplot(rnorm(10), rnorm(10))+geom_vline(xintercept = 0, colour = "red")
+geom_hline(yintercept = 0, colour = "red")+coord_equal()

The degree of intercept error varies by how much the coordinates were
adjusted, so repeat that code to get an idea of the range of
deviations.

It also doesn't seem to matter whether coord_equal is added before or
after the geom_vline and geom_hline layers.

qplot(rnorm(10), rnorm(10))+coord_equal()+geom_vline(xintercept = 0,
colour = "red")+geom_hline(yintercept = 0, colour = "red")

Cheers,

Joe

hadley wickham

unread,
Jan 20, 2010, 10:05:05 AM1/20/10
to Joe, ggplot2
Hi Joe,

That's fixed in the next version of ggplot2.

Hadley

> --
> You received this message because you are subscribed to the ggplot2 mailing list.
> To post to this group, send email to ggp...@googlegroups.com
> To unsubscribe from this group, send email to
> ggplot2+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/ggplot2
>

--
http://had.co.nz/

Reply all
Reply to author
Forward
0 new messages