Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot.fds

Plot functional objects


Description

Plot functional curves.

Usage

## S3 method for class 'fds'
plot(x, plot.type = c("functions", "time", "depth", "density"),
  col = NULL, type = "l", lty = 1, xlab = x$xname, ylab = x$yname, 
  pch = c(1:9,0, letters, LETTERS), add = FALSE, index,     
  colorchoice = c("rainbow", "heat.colors", "terrain.colors", 
  "topo.colors", "cm.colors", "rainbow_hcl", "gray", "sequential_hcl", 
  "heat_hcl", "terrain_hcl", "diverge_hcl"), plotlegend = FALSE, 
  legendpos = "topright", ncol = 1, ...)
## S3 method for class 'fds'
lines(x, type = "l", index, ...)
## S3 method for class 'fds'
points(x, type = "p", index, ...)

Arguments

x

An object of class fds or fts.

plot.type

Type of plot. See details for more explanations.

col

Colors to use in plot. Default in plot.fds is to use a rainbow color palette with the number of colors equal to the number of functions.

type

1-character string giving the type of plot desired.

lty

The line type.

xlab

A title for x axis.

ylab

A title for y axis.

pch

Either an integer specifying a symbol or a single character to be used as the default in plotting points.

add

If add = TRUE, it plots a line or points.

index

Index of a specific curve that is plotted as a line or points.

colorchoice

Color palette used for drawing the rainbow plot.

plotlegend

Add a legend to the graph.

legendpos

Position of legend.

ncol

Number of column in the legend.

...

Other plotting parameters passed to par.

Details

If plot.type = "functions", then functions are plotted using a rainbow color palette so the first few functions are shown in red, followed by orange, yellow, green, blue and indigo with the last few functions plotted in violet.

If plot.type = "time", then each value of x is shown as a separate time series in a time plot.

If plot.type = "depth", then functions are first ordered by depth and then plotted using a rainbow color palette.

If plot.type = "density", then functions are first ordered by density and then plotted using a rainbow color palette.

Value

Function produces a plot.

Author(s)

Rob J Hyndman, Han Lin Shang. Please, report bugs and suggestions to hanlin.shang@anu.edu.au

References

R. J. Hyndman and H. L. Shang. (2010) "Rainbow plots, bagplots, and boxplots for functional data", Journal of Computational and Graphical Statistics, 19(1), 29-45.

See Also

Examples

plot(x = ElNino_OISST_region_1and2, plot.type = "functions", legend = TRUE)
lines(x = ElNino_OISST_region_1and2, plot.type = "functions", index = 3)
points(x = ElNino_OISST_region_1and2, plot.type = "functions", index = 3)

rainbow

Bagplots, Boxplots and Rainbow Plots for Functional Data

v3.6
GPL-3
Authors
Han Lin Shang [aut, cre, cph] (<https://orcid.org/0000-0003-1769-6430>), Rob Hyndman [aut] (<https://orcid.org/0000-0002-2140-5352>)
Initial release
2019-1-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.