Re: [R] multiple lines and plot

From: David Barron <mothsailor_at_googlemail.com>
Date: Wed 20 Sep 2006 - 09:35:00 GMT

You can specify the same type parameter in either lines() or points() that can be used in plot(). So, if you want to show points as well as lines, use the following:

x <- c(1,2,3,4,5,6)
y <- c(3,5,2,4,1,4)
z <- c(2,3,4,3,2,1)

plot(x,y,type="b")
lines(x,z,col="red",type="b")

On 20/09/06, Mauricio Cardeal <mcardeal@ufba.br> wrote:
> Ok. Ive already tried ?lines. An example:
>
> x <- c(1,2,3,4,5,6)
> y <- c(3,5,2,4,1,4)
> z <- c(2,3,4,3,2,1)
> plot(x,y)
> lines(x,y)
> lines(x,z)
>
> Here is the point: how to show the points under the second line (x,z) ?
>
> Thanks
> Mauricio
>
>
> David Barron escreveu:
> > ?lines
> >
> > On 20/09/06, Mauricio Cardeal <mcardeal@ufba.br> wrote:
> >> Hi. Please, how can I put together 2 or more lines at the same
> >> scatterplot ? Example: measures of protein intake (quantitative) of 4
> >> children over 30 days, by day. How to plot all children at same graphic:
> >> Protein X Time ? Is there any command like "overlay" ?
> >>
> >> Thank you,
> >> Mauricio
> >>
> >> ______________________________________________
> >> R-help@stat.math.ethz.ch 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.
> >>
> >
> >
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.
>

-- 
=================================
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP

______________________________________________
R-help@stat.math.ethz.ch 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.
Received on Wed Sep 20 19:37:47 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 20 Sep 2006 - 10:30:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.