powered by
Plotting methods for xts objects.
# S3 method for 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, ...)
an xts object
xts
an xts object or NULL
type of plot to produce
should grid lines be drawn
should major tickmarks be drawn and labeled
should minor tickmarks be drawn
passed along to axTicksByTime. See also
the color of the bars when type is ‘bars’ or ‘candles’
the color of the candles when type is ‘candles’
passed ‘par’ graphical parameter
additional graphical arguments
Plots an xts object to the current device.
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'.
type='candles'
type='bars'
Better financial plots can be found in the quantmod package, though these are generally incompatible with standard R graphics tools.
# NOT RUN { data(sample_matrix) plot(sample_matrix) plot(as.xts(sample_matrix)) plot(as.xts(sample_matrix), type='candles') # }
Run the code above in your browser using DataLab