Description Usage Arguments Details See Also Examples
Plot time series !PLEASE USE plot_dts!
1 2 3 4 5 6 7 8 | plot_ts(dt, type = "auto", col = "auto", lty = par("lty"),
lwd = par("lwd"), pch = par("pch"), legend = c("topright", "topleft",
"bottomright", "bottomleft", "n"), last_values = TRUE, main = "",
ylim = "auto", xlim = "auto", time_range = "auto",
resolution = "auto", log = par("ylog"), mar = par("mar"),
xaxt = par("xaxt"), add = par("new"))
t_to_x(t)
|
dt |
|
type |
type vector or single value. Same as in |
col |
color vector or single value. Default is |
lty, lwd, pch |
parameters vectors or single values. Same as in |
legend |
position of plot legend. Supported positions are |
last_values |
whether to add last values marks to the right of the plot. If vector specified marks added only for columns specified in vector |
main |
title of the plot. Default is |
ylim |
y range of data to plot |
xlim |
x range of data to plot |
time_range |
time range in format |
resolution |
frequency of time marks on time axis. Supported resolutions are |
log |
should y axis be in logarithmic scale? |
mar |
same as in |
xaxt |
same as in |
add |
add to existing plot? |
t |
date/time vector to be converted to plot x coordinates |
Plots time series each represented by columns of times_series
on single plot.
As for OHLC series, only one can be plotted and should be passed as times_series
with 4 columns 'open','high','low','close'
.
Other graphical functions: add_last_values
,
add_legend
, distinct_colors
,
empty_plot
, hist_dt
,
lines_ohlc
,
lines_stacked_hist
,
multi_heatmap
, plot_table
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | data( ticks )
time_series = to_candles( ticks, 60 * 10 )
plot_ts( time_series[ time %bw% '2016-05-13', list( time, open, high, low, close ) ] )
plot_ts( time_series[ time %bw% '2016-05-13', list( time, volume = volume / 1e6 ) ] , type = 'h' )
plot_ts( time_series[ time %bw% '2016-05', list( time, close ) ] )
plot_ts( time_series[ , list( time, close ) ] )
mar = par( 'mar' )
par( mar = c( 0, 4, 0, 4 ), xaxt = 'n' )
layout ( matrix( 1:(3 + 2) ), heights = c( 1, 4, 2, 2, 1 ) )
empty_plot()
plot_ts( time_series[ , list( time, open, high, low, close ) ] )
plot_ts( time_series[ , list( time, close ) ] )
par( xaxt = 's' )
plot_ts( time_series[ , list( time, volume = volume / 1e6 ) ], type = 'h' )
empty_plot()
par( mar = mar )
layout( matrix(1) )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.