[R] plots

Vladimir Eremeev wl2776 at gmail.com
Wed Jul 25 12:35:32 CEST 2007



amna khan wrote:
> 
> I did not find any function of graph which plot one variable on x-axis and
> 2
> or more than 2 variables on y-axis.
> 

You can use xyplot() from the package lattice.
library(lattice)
xyplot(y1+y2+y3~x)

I suspect, the problem is, that plot() erases everything that was plotted
earlier and establishes a new coordinate system in the plotting window.

In case of basic graphics, you can set par(new=TRUE) and call plot() several
times. 

points(), lines() and other functions from the basic graphics will add new
curves to the existing plot.

Initially, you must set axis ranges large enough to fit everything you want
to plot.
-- 
View this message in context: http://www.nabble.com/plots-tf4141246.html#a11780013
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list