Learn R Programming

broman (version 0.84)

timeplot: Scatterplot with date/times on the x-axis

Description

Like the grayplot() function, but with the x-axis having date/times

Usage

timeplot(x, y, ..., n = 5, scale = NULL, format = NULL)

Value

None.

Arguments

x

X-axis coordinates of points for the plot (must be date/time values)

y

Y-axis coordinates of points for the plot

...

Optional graphics arguments passed to grayplot()

n

Approximate number of x-axis labels (passed to base::pretty()).

scale

Passed to time_axis() for defining the x-axis labels

format

Passed to time_axis() for defining the x-axis labels

See Also

time_axis(), grayplot(), dotplot()

Examples

Run this code
n <- 100
y <- rnorm(n)
x <- seq(as.POSIXct("2024-05-01 11:23"), as.POSIXct("2024-05-01 14:50"), length.out=n)
timeplot(x, y)

Run the code above in your browser using DataLab