How do I plot two time series plots on the same chart? Thanks, Jason [[alternative HTML version deleted]]
On Fri, Oct 29, 2010 at 1:41 PM, Jason Kwok <jaykwok at gmail.com> wrote:> How do I plot two time series plots on the same chart? >Try this: example(plot.ts) example(ts.plot) library(zoo) example(plot.zoo) library(lattice) example(xyplot.zoo) -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com
> When I use > >> Plot(series1) >> lines(series2) >> >> The graph will use the y axis scaling for series 1 so some of series2 is>> cut off. How do I control the y axis scaling? > >Plot them together as a multivariate series as in the examplesalready>pointed to....or try plot(series1, type="l", ylim=range(pretty(c(series1, series2))) ) lines(series2) which gives more-or-less sensible ylim scaling based on all the data. Adding 0 inside the c() will guarantee that zero is in the vertical scale, too. ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}}