--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
something like ggplot() + draw_line(c(10,10),c(29,38))
Best,
Thomas
> ------------------------------------------------------------------------
>
> Scott Chamberlain <mailto:myrmec...@gmail.com>
> 22 May 2011 8:06 PM
doesn't that only work on an 'empty' plot?
i have something like this
data = data.frame(x = seq(0,50,1),y= seq(0,50,1),l = seq(100,150,1))
p = ggplot(data,aes(x=x,y=y,label=l))
p = p + geom_text(size=2)
doing
p = p + geom_line(aes(x=c(10,10),y=c(15,15))
isn't working. Throws an error complaining about the number of rows ":
2, 51". 51 probably stems from data.
Thomas
> ------------------------------------------------------------------------
>
> Heike Hofmann <mailto:heike....@gmail.com>
> 22 May 2011 8:23 PM
>
>
> Thomas,
>
> try
>
> ggplot() + geom_line(aes(x=c(10,10),y=c(29,38)))
>
> Heike
>
>
>
that actually worked, thanks.
Scott,
that seems to be working as well thanks.
Best,
Thomas
> ------------------------------------------------------------------------
>
> Scott Chamberlain <mailto:myrmec...@gmail.com>
> 22 May 2011 9:53 PM
>
>
> How about geom_segment:
>
> dat <- data.frame(var1 = c(1,2), var2 = c(2,1))
> ggplot(dat, aes(x = var1, y = var2)) +
> geom_point()
> last_plot() + geom_segment(aes(x = 2, y = 1, xend = 1, yend = 2))
>
> On Sunday, May 22, 2011 at 1:35 PM, Thomas Kern wrote:
>
>
> ------------------------------------------------------------------------
>
> Thomas Kern <mailto:thk....@gmail.com>
> 22 May 2011 8:35 PM
>
>
> Heike,
>
> doesn't that only work on an 'empty' plot?
>
> i have something like this
>
> data = data.frame(x = seq(0,50,1),y= seq(0,50,1),l = seq(100,150,1))
> p = ggplot(data,aes(x=x,y=y,label=l))
> p = p + geom_text(size=2)
>
> doing
>
> p = p + geom_line(aes(x=c(10,10),y=c(15,15))
>
> isn't working. Throws an error complaining about the number of rows ":
> 2, 51". 51 probably stems from data.
>
> Thomas
>
>
>
> ------------------------------------------------------------------------
>
> Heike Hofmann <mailto:heike....@gmail.com>
> 22 May 2011 8:23 PM
>
>
> Thomas,
>
> try
>
> ggplot() + geom_line(aes(x=c(10,10),y=c(29,38)))
>
> Heike
>
>
>
> ------------------------------------------------------------------------
>
> Thomas Kern <mailto:thk....@gmail.com>
> 22 May 2011 8:18 PM
>
>
> no, I meant between two points that have nothing to do with the dataset.
>
> something like ggplot() + draw_line(c(10,10),c(29,38))
>
> Best,
> Thomas
>
>