plot.xts {xts} | R Documentation |
Plotting methods for xts objects.
## S3 method for class 'xts' plot(x, y = NULL, type = "l", auto.grid = TRUE, major.ticks = "auto", minor.ticks = TRUE, major.format = TRUE, bar.col = "grey", candle.col = "white", ann = TRUE, axes = TRUE, ...)
x |
an |
y |
an |
type |
type of plot to produce |
auto.grid |
should grid lines be drawn |
major.ticks |
should major tickmarks be drawn and labeled |
minor.ticks |
should minor tickmarks be drawn |
major.format |
passed along to axTicksByTime. See also |
bar.col |
the color of the bars when type is ‘bars’ or ‘candles’ |
candle.col |
the color of the candles when type is ‘candles’ |
ann |
passed ‘par’ graphical parameter |
axes |
passed ‘par’ graphical parameter |
... |
additional graphical arguments |
Mainly used to draw time-series plots with sensible x-axis labels, it
can also plot basic OHLC series using type='candles'
or type='bars'
.
Better financial plots can be found in the quantmod package, though these are generally incompatible with standard R graphics tools.
Plots an xts object to the current device.
Jeffrey A. Ryan
data(sample_matrix) plot(sample_matrix) plot(as.xts(sample_matrix)) plot(as.xts(sample_matrix), type='candles')