[R] A question on plotting

Uwe Ligges ligges at statistik.uni-dortmund.de
Sat Dec 29 21:50:51 CET 2001

> I have a question on plotting. Suppose I have two vectors x and y 
> consisting of equal number of elements.
> Say x be the observed values of a time series and y be the fitted 
> values. I would like to plot the two sets of data on the same graph. 
> How would I go about doing this? If they are plotted on different 
> graphs but in the same window like one would get if one used the 
> command scatter.smooth with times series data, that would do too.

Please, could you specify your question more precisely?

Do you mean two plots (with seperate coordinate systems) or just two
kinds of symbols (colors representing different types of values) in the
same plot? Or .... ?

Nevertheless, whatever you are asking right now, I guess your question
(any kind of multiple plots in one window, if I understand right) is
already answered in

a) An Introduction to R,
b) the FAQs, or
c) the mailing list archives.

But if you want to reproduce the behaviour of the function
scatter.smooth(), simply look into its code, which is really simple to
understand! --- and mainly consists of i)   a call to loess.smooth()
ii)  the plot()
iii) and adding some lines()

Uwe Ligges
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list