s-news
[Top] [All Lists]

Re: Last question about plot (and NA)

To: "Tristan Lorino" <tristan.lorino@lcpc.fr>
Subject: Re: Last question about plot (and NA)
From: "Dimitris Rizopoulos" <dimitris.rizopoulos@med.kuleuven.be>
Date: Fri, 10 Mar 2006 15:04:46 +0100
Cc: <s-news@lists.biostat.wustl.edu>
References: <ef09a721.96524e12.81a0400@po-d.temple.edu> <952415259.20060310145611@lcpc.fr>
try something like the following:

plot(x$u, x$v, ylim = c(1, 10), type="l")
ind <- !is.na(x$w)
lines(x$u[ind], x$w[ind], col=8, type = "b", pch = 1)


I hope it helps.

Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://www.med.kuleuven.be/biostat/
    http://www.student.kuleuven.be/~m0390867/dimitris.htm


----- Original Message ----- From: "Tristan Lorino" <tristan.lorino@lcpc.fr>
To: <s-news@lists.biostat.wustl.edu>
Sent: Friday, March 10, 2006 2:56 PM
Subject: [S] Last question about plot (and NA)


Thank you for your help. These days, I spend a lot of time on
SPlus, so... I hope this will be my last question before a long
time!

I would like 2 plots on the same graphic:

x_data.frame(u=c(1,2,3,4,5),v=c(5,4,9,7,4),w=c(2,NA,7,NA,3))
plot(x$u,x$v,ylim=c(1,10),type="l")
points(x$u,x$w,col=8,type="p")

But I would like to have 2 lines, instead of one line (x$v) and 3
points (x$w). If I write
points(x$u,x$w,col=8,type="l")
the second plot is not plotted  -- because of NA.

How can I resolve this problem?

Thank you,
Tristan Lorino


--
Laboratoire Central des Ponts et Chaussées
[Division ESAR ? Section AGR]
Route de Bouaye BP 4129
44341 Bouguenais Cedex
France
Tél. 33 (0)2 40 84 56 18

--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu.  To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message:  unsubscribe s-news



Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm


<Prev in Thread] Current Thread [Next in Thread>