Roslina Zakaria
2010-Jun-04 03:34 UTC
[R] horizontal and vertical line with arrow in a plot
Hi r-users, I would like to add a plot of vertical line segment with arrow from (77,.6) to (77,0) and also a horizontal line segment with arrow from (0,0.6) to (77,.6) . So far this is what I have: plot(sq, cdf, type="l", lwd=4,col="blue",xaxs="i",yaxs="i", xlab= "Rainfall (mm)", ylab= "Random no.", main="Random number and rainfall totals (mm)") abline(v=77,h=0.6,col=2,lwd=2,lty=3) text(120,0.63, "r = 0.6") text(120,0.05, "x = 70") I also tried to use the 'diagram' and 'shape' package but not really sure how to use them. Thank you for all the help given. [[alternative HTML version deleted]]
Tena koe Roslina ?arrows HTH .... Peter Alspach> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Roslina Zakaria > Sent: Friday, 4 June 2010 3:34 p.m. > To: r-help at r-project.org > Subject: [R] horizontal and vertical line with arrow in a plot > > Hi r-users, > > I would like to add a plot?of vertical line segment with arrow from > (77,.6) to (77,0) and also a horizontal??line segment with arrow from > (0,0.6) to (77,.6)?.? So far this is what I have: > > plot(sq, cdf, type="l", lwd=4,col="blue",xaxs="i",yaxs="i", xlab> "Rainfall (mm)", ylab= "Random no.", main="Random number? and rainfall > totals (mm)") > abline(v=77,h=0.6,col=2,lwd=2,lty=3) > text(120,0.63, "r = 0.6") > text(120,0.05, "x = 70") > > I also tried to use the 'diagram' and 'shape' package but not really > sure how to use them. > > Thank you for all the help given. > > > > [[alternative HTML version deleted]]
# A very quick example of how to draw an arrow on a graph. plot(1:10) text(2,5, "Point 5 ", cex=.8) arrows(3,5, 4.5, 5) --- On Thu, 6/3/10, Roslina Zakaria <zroslina at yahoo.com> wrote:> From: Roslina Zakaria <zroslina at yahoo.com> > Subject: [R] horizontal and vertical line with arrow in a plot > To: r-help at r-project.org > Received: Thursday, June 3, 2010, 11:34 PM > Hi r-users, > > I would like to add a plot?of vertical line segment with > arrow from (77,.6) to (77,0) and also a horizontal??line > segment with arrow from (0,0.6) to (77,.6)?.? So far this > is what I have: > > plot(sq, cdf, type="l", lwd=4,col="blue",xaxs="i",yaxs="i", > xlab= "Rainfall (mm)", ylab= "Random no.", > main="Random number? and rainfall totals (mm)") > abline(v=77,h=0.6,col=2,lwd=2,lty=3) > text(120,0.63, "r = 0.6") > text(120,0.05, "x = 70") > > I also tried to use the 'diagram' and 'shape' package but > not really sure how to use them. > > Thank you for all the help given. > > > ? ? ? > ??? [[alternative HTML version deleted]] > > > -----Inline Attachment Follows----- > > ______________________________________________ > R-help at r-project.org > mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, > reproducible code. >