Skip to contents

Plot Zoo Time Series

Usage

zoo_plot(
  x = NULL,
  xlim = NULL,
  ylim = NULL,
  color = NULL,
  width = 1,
  title = NULL,
  xlab = NULL,
  ylab = NULL,
  text_cex = 1,
  guide = TRUE,
  guide_cex = 0.8,
  vertical = FALSE,
  subpanel = FALSE
)

Arguments

x

(required, zoo object) zoo time series. Default: NULL

xlim

(optional, numeric vector) Numeric vector with the limits of the x axis. Default: NULL

ylim

(optional, numeric vector) Numeric vector with the limits of the x axis. Default: NULL

color

(optional, character vector) vector of colors for the distance or cost matrix. If NULL, uses an appropriate palette generated with grDevices::palette.colors(). Default: NULL

width

(optional, numeric vector) Width of the time series lines. Default: 1

title

(optional, character string) Main title of the plot. If NULL, it's set to the name of the time series. Default: NULL

xlab

(optional, character string) Title of the x axis. Disabled if subpanel or vertical are TRUE. If NULL, the word "Time" is used. Default: NULL

ylab

(optional, character string) Title of the x axis. Disabled if subpanel or vertical are TRUE. If NULL, it is left empty. Default: NULL

text_cex

(optional, numeric) Multiplicator of the text size. Default: 1

guide

(optional, logical) If TRUE, plots a legend. Default: TRUE

guide_cex

(optional, numeric) Size of the guide's text and separation between the guide's rows. Default: 0.7.

vertical

(optional, logical) For internal use within the package in multipanel plots. Switches the plot axes. Disabled if subpanel = FALSE. Default: FALSE

subpanel

(optional, logical) For internal use within the package in multipanel plots. Strips down the plot for a sub-panel. Default: FALSE

Value

A plot.

Examples


#simulate zoo time series
x <- zoo_simulate()

if(interactive()){

  zoo_plot(
    x = x,
    xlab = "Date",
    ylab = "Value",
    title = "My time series"
  )

}