[R] function plot.double (different data on the same plot)

Ott Toomet siim at obs.ee
Thu Jun 20 08:19:46 CEST 2002


Hi,

On Thu, 20 Jun 2002, Susana Barbosa wrote:

  |Hi,
  |
  |I would like to plot on the same graph vertical lines from points of two 
  |different data sets to the zero axis 
  |(x1,y1) and (x2,y2) (y1>0, y2<0)

I am not quite sure what you want, but the example below gives a picture
which perhaps is good enough.  Note that lines() can be used not only for
lines:

x <- rnorm(10)
y <- rnorm(10)
plot(1:10,x, type="h", ylim=range(c(x,y))) # plot x against 1:10
lines(1:10+0.1,y, type="h", col=2)         # plot y shifted a bit right

Perhaps it helps

Ott

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list