zoo_plot function

Plot Zoo Time Series

Plot Zoo Time Series

zoo_plot( x = NULL, line_color = NULL, line_width = 1, xlim = NULL, ylim = NULL, title = NULL, xlab = NULL, ylab = NULL, text_cex = 1, guide = TRUE, guide_position = "topright", guide_cex = 0.8, vertical = FALSE, subpanel = FALSE )

Arguments

  • x: (required, zoo object) zoo time series. Default: NULL
  • line_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
  • line_width: (optional, numeric vector) Width of the time series lines. Default: 1
  • 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
  • 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_position: (optional, vector of xy coordinates or character string). This is a condensed version of the x and y arguments of the graphics::legend() function. Coordinates (in the range 0 1) or keyword to position the legend. Accepted keywords are: "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center". Default: "topright".
  • 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

Returns

A plot.

Examples

#simulate zoo time series x <- zoo_simulate() if(interactive()){ zoo_plot( x = x, xlab = "Date", ylab = "Value", title = "My time series" ) }

See Also

Other zoo_functions: zoo_aggregate(), zoo_name_clean(), zoo_name_get(), zoo_name_set(), zoo_permute(), zoo_resample(), zoo_smooth_exponential(), zoo_smooth_window(), zoo_time(), zoo_to_tsl(), zoo_vector_to_matrix()

  • Maintainer: Blas M. Benito
  • License: MIT + file LICENSE
  • Last published: 2025-02-01