plot_ts: Plot time series chart

View source: R/graphics.R

plot_tsR Documentation

Plot time series chart

Description

Simple time series plot with points and a line.

Usage

plot_ts(x = NULL, y, label_x = "", label_y = "", color = "black")

Arguments

x

time index (numeric vector) or NULL to use 1:length(y)

y

numeric series

label_x

x‑axis label

label_y

y‑axis label

color

color for the series

Details

If x is NULL, an integer index 1:n is used. The color applies to both points and line.

Value

returns a ggplot2::ggplot graphic

Examples

x <- seq(0, 10, 0.25)
y <- sin(x)

grf <- plot_ts(x = x, y = y, color=c("red"))
plot(grf)

daltoolbox documentation built on Nov. 5, 2025, 7:09 p.m.