draw_xt | R Documentation |
Plot timeseries data
draw_xt(
x,
y = NULL,
x2 = NULL,
y2 = NULL,
which_xy = NULL,
which_xy2 = NULL,
shade_bin = NULL,
shade_interval = NULL,
shade_col = NULL,
shade_x = NULL,
shade_name = "",
shade_showlegend = FALSE,
ynames = NULL,
y2names = NULL,
xlab = NULL,
ylab = NULL,
y2lab = NULL,
xunits = NULL,
yunits = NULL,
y2units = NULL,
yunits_col = NULL,
y2units_col = NULL,
zt = NULL,
show_zt = TRUE,
show_zt_every = NULL,
zt_nticks = 18L,
main = NULL,
main_y = 1,
main_yanchor = "bottom",
x_nticks = 0,
y_nticks = 0,
show_rangeslider = NULL,
slider_start = NULL,
slider_end = NULL,
theme = choose_theme(),
palette = rtpalette(rtemis_palette),
font_size = 16,
yfill = "none",
y2fill = "none",
fill_alpha = 0.2,
yline_width = 2,
y2line_width = 2,
x_showspikes = TRUE,
spike_dash = "solid",
spike_col = NULL,
x_spike_thickness = -2,
tickfont_size = 16,
x_tickmode = "auto",
x_tickvals = NULL,
x_ticktext = NULL,
x_tickangle = NULL,
legend_x = 0,
legend_y = 1.1,
legend_xanchor = "left",
legend_yanchor = "top",
legend_orientation = "h",
margin = list(l = 75, r = 75, b = 75, t = 75),
x_standoff = 20L,
y_standoff = 20L,
y2_standoff = 20L,
hovermode = "x",
displayModeBar = TRUE,
modeBar_file_format = "svg",
scrollZoom = TRUE,
filename = NULL,
file_width = 960,
file_height = 500,
file_scale = 1
)
x |
Datetime vector or list of vectors OR object of class |
y |
Numeric vector or named list of vectors: y-axis data. |
x2 |
Datetime vector or list of vectors, optional: must be provided if |
y2 |
Numeric vector, optional: If provided, a second y-axis will be added to the right side of the plot. |
which_xy |
Integer vector: Indices of |
which_xy2 |
Integer vector: Indices of |
shade_bin |
Integer vector {0, 1}: Time points in |
shade_interval |
List of numeric vectors: Intervals to shade on the plot. Only set
|
shade_col |
Color: Color to shade intervals. |
shade_x |
Numeric vector: x-values to use for shading. |
shade_name |
Character: Name for shaded intervals. |
shade_showlegend |
Logical: If TRUE, show legend for shaded intervals. |
ynames |
Character vector, optional: Names for each vector in |
y2names |
Character vector, optional: Names for each vector in |
xlab |
Character: x-axis label. |
ylab |
Character: y-axis label. |
y2lab |
Character: y2-axis label. |
xunits |
Character: x-axis units. |
yunits |
Character: y-axis units. |
y2units |
Character: y2-axis units. |
yunits_col |
Color for y-axis units. |
y2units_col |
Color for y2-axis units. |
zt |
Numeric vector: Zeitgeber time. If provided, will be shown on the x-axis instead of
|
show_zt |
Logical: If TRUE, show zt on x-axis, if zt is provided. |
show_zt_every |
Integer: Show zt every |
zt_nticks |
Integer: Number of zt ticks to show. Only used if |
main |
Character: Main title. |
main_y |
Numeric: Y position of main title. |
main_yanchor |
Character: "top", "middle", "bottom". |
x_nticks |
Integer: Number of ticks on x-axis. |
y_nticks |
Integer: Number of ticks on y-axis. |
show_rangeslider |
Logical: If TRUE, show a range slider. |
slider_start |
Numeric: Start of range slider. |
slider_end |
Numeric: End of range slider. |
theme |
Theme object. |
palette |
Color list: will be used to draw each vector in |
font_size |
Numeric: Font size for text. |
yfill |
Character: Fill type for y-axis: "none", "tozeroy", "tonexty". |
y2fill |
Character: Fill type for y2-axis: "none", "tozeroy", "tonexty". |
fill_alpha |
Numeric: Fill opacity for y-axis. |
yline_width |
Numeric: Line width for y-axis lines. |
y2line_width |
Numeric: Line width for y2-axis lines. |
x_showspikes |
Logical: If TRUE, show spikes on x-axis. |
spike_dash |
Character: Dash type for spikes: "solid", "dot", "dash", "longdash", "dashdot", "longdashdot". |
spike_col |
Color for spikes. |
x_spike_thickness |
Numeric: Thickness of spikes. |
tickfont_size |
Numeric: Font size for tick labels. |
x_tickmode |
Character: "auto", "linear", "array". |
x_tickvals |
Numeric vector: Tick positions. |
x_ticktext |
Character vector: Tick labels. |
x_tickangle |
Numeric: Angle of tick labels. |
legend_x |
Numeric: X position of legend. |
legend_y |
Numeric: Y position of legend. |
legend_xanchor |
Character: "left", "center", "right". |
legend_yanchor |
Character: "top", "middle", "bottom". |
legend_orientation |
Character: "v" for vertical, "h" for horizontal. |
margin |
Named list with 4 numeric values: "l", "r", "t", "b" for left, right, top, bottom margins. |
x_standoff |
Numeric: Distance from x-axis to x-axis label. |
y_standoff |
Numeric: Distance from y-axis to y-axis label. |
y2_standoff |
Numeric: Distance from y2-axis to y2-axis label. |
hovermode |
Character: "closest", "x", "x unified". |
displayModeBar |
Logical: If TRUE, display plotly mode bar. |
modeBar_file_format |
Character: "png", "svg", "jpeg", "webp", "pdf": file format for mode bar image export. |
scrollZoom |
Logical: If TRUE, enable zooming by scrolling. |
filename |
Character: Path to save the plot image. |
file_width |
Numeric: Width of the saved plot image. |
file_height |
Numeric: Height of the saved plot image. |
file_scale |
Numeric: Scale of the saved plot image. |
We are switching to palette
being a color vector instead of the name of a built-in palette.
plotly
object.
EDG
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.