Re: [R] Plotting 3 vectors on one graph.

From: jim holtman <jholtman_at_gmail.com>
Date: Sat, 2 Feb 2008 07:56:20 -0500

What you want to do is to use 'plot' for the initial vector and then "lines" to add the other two. You will have to set the range of the y-axis in the initial call to "plot". The sequence would probably look like this:

plot(a, ylim=range(a, b, c), col='black')
lines(b, col='red')
lines(c, col='green')

On Feb 1, 2008 7:06 PM, cvandy <cvandy26_at_gmail.com> wrote:
>
> I'm an R newbie and am trying to plot 3 vectors, say a,b,c. I have
> downloaded 3 R manuals and searched your forum. There are plenty of X vs Y
> examples, but cannot find how to plot 3, or more vectors one one graph. I'm
> sure I overlooked something.
> Thanks for any help.
> CHV
> --
> View this message in context: http://www.nabble.com/Plotting-3-vectors-on-one-graph.-tp15236552p15236552.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>

-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

______________________________________________
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.
Received on Sat 02 Feb 2008 - 12:59:27 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 02 Feb 2008 - 13:30:12 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.

list of date sections of archive