-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
project.org] On Behalf Of Rui Barradas
Sent: Thursday, January 03, 2013 12:54 PM
To: Bruce Kindseth
Cc: r-help at r-project.org
Subject: Re: [R] How to plot multiple datasets
Hello,
You shuld provide a data example, but see if the following is what you
are looking for.
x <- 1:10
y1 <- rnorm(10)
y2 <- rnorm(10)
y3 <- rnorm(10)
# One way
plot(x, y1, ylim = range(c(y1, y2, y3)))
points(x, y2, col = "red")
points(x, y3, col = "blue")
# Another way
plot(x, y1, ylim = range(c(y1, y2, y3)), type = "l")
lines(x, y2, col = "red")
lines(x, y3, col = "blue")
Hope this helps,
Rui Barradas
Em 03-01-2013 16:39, Bruce Kindseth escreveu:
Good Morning,
I have 3 sets of data, all with the same horizontal axis but with
vertical input. I want to plot all 3 sets on one x-y plot. I can
linear regression plots and 3 polynomial regression plots on the same
but I have not been able to get more than one set of input data on
chart. Can you help me?
Thank you for all that you do to provide R to the public.
Bruce Kindseth
Narragansett, RI
[[alternative HTML version deleted]]