Plot time series against lagged versions of themselves. Helps visualizing ‘auto-dependence’ even when auto-correlations vanish.

1 2 3 4 5 |

`x` |
time-series (univariate or multivariate) |

`lags` |
number of lag plots desired, see arg |

`layout` |
the layout of multiple plots, basically the |

`set.lags` |
vector of positive integers allowing specification of
the set of lags used; defaults to |

`main` |
character with a main header title to be done on the top of each page. |

`asp` |
Aspect ratio to be fixed, see |

`diag` |
logical indicating if the x=y diagonal should be drawn. |

`diag.col` |
color to be used for the diagonal |

`type` |
plot type to be used, but see |

`oma` |
outer margins, see |

`ask` |
logical or |

`do.lines` |
logical indicating if lines should be drawn. |

`labels` |
logical indicating if labels should be used. |

`...` |
Further arguments to |

If just one plot is produced, this is a conventional plot. If more
than one plot is to be produced, `par(mfrow)`

and several other
graphics parameters will be set, so it is not (easily) possible to mix
such lag plots with other plots on the same page.

If `ask = NULL`

, `par(ask = TRUE)`

will be called if more than
one page of plots is to be produced and the device is interactive.

It is more flexible and has different default behaviour than
the S version. We use `main =`

instead of `head = `

for
internal consistency.

Martin Maechler

`plot.ts`

which is the basic work horse.

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
require(graphics)
lag.plot(nhtemp, 8, diag.col = "forest green")
lag.plot(nhtemp, 5, main = "Average Temperatures in New Haven")
## ask defaults to TRUE when we have more than one page:
lag.plot(nhtemp, 6, layout = c(2,1), asp = NA,
main = "New Haven Temperatures", col.main = "blue")
## Multivariate (but non-stationary! ...)
lag.plot(freeny.x, lags = 3)
## no lines for long series :
lag.plot(sqrt(sunspots), set = c(1:4, 9:12), pch = ".", col = "gold")
``` |

What can we improve?

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.

Close