dear userRs, I am deeply ashamed asking you this very basic question, but I did neither get it online nor by the S/R-literature I have. I simply want to plot the values of a COUPLE of vectors within one graph - in concrete a couple of time series, a couple of distributions and some stacked area graphs. I am higly convinced, that there are dozens of solutions. Could you please recommend me one? All the best, Norbert
Norbert NEUWIRTH <norbert.s.neuwirth <at> univie.ac.at> writes:> > I am deeply ashamed asking you this very basic question, but I did neither getit online nor by the> S/R-literature I have. > > I simply want to plot the values of a COUPLE of vectors within one graph - inconcrete a couple of time series, a> couple of distributions and some stacked area graphs. I am higly convinced,that there are dozens of> solutions. Could you please recommend me one?It would be good if you provide a data set and an example that comes close to what you want. With standard graphic, check the use of "lines" instead of plot. And for lattice, have a look at http://dsarkar.fhcrc.org/lattice/book/figures.html for example Fig 15.12 is a bit similar to your request. Dieter
On 20/06/2008 4:09 AM, Norbert NEUWIRTH wrote:> dear userRs, > > I am deeply ashamed asking you this very basic question, but I did neither get it online nor by the S/R-literature I have. > > I simply want to plot the values of a COUPLE of vectors within one graph - in concrete a couple of time series, a couple of distributions and some stacked area graphs. I am higly convinced, that there are dozens of solutions. Could you please recommend me one?x <- 1:1000 y1 <- rnorm(1000) y2 <- rexp(1000) ylim <- range(c(y1,y2)) plot(x, y1, col="blue", ylim = ylim) points(x, y2, col="red") Duncan Murdoch
Duncan Murdoch wrote:> On 20/06/2008 4:09 AM, Norbert NEUWIRTH wrote: >> dear userRs, >> I am deeply ashamed asking you this very basic question, but I did >> neither get it online nor by the S/R-literature I have. >> I simply want to plot the values of a COUPLE of vectors within one >> graph - in concrete a couple of time series, a couple of >> distributions and some stacked area graphs. I am higly convinced, >> that there are dozens of solutions. Could you please recommend me one? > > > x <- 1:1000 > y1 <- rnorm(1000) > y2 <- rexp(1000) > ylim <- range(c(y1,y2)) > plot(x, y1, col="blue", ylim = ylim) > points(x, y2, col="red") >x <- 1:1000 y1 <- rnorm(1000) y2 <- rexp(1000) matplot(x, cbind(y1, y2), pch="o") vQ