Learn R Programming

oce (version 0.2-1)

stickplot: Draw a stick-plot diagram

Description

Draw a stick-plot diagram, with line segments indicating (x,y) values, arranged along a horizontal axis representing t.

Usage

stickplot(t, x, y, ...)

Arguments

t
Time
x
horizontal component of line segment
y
vertical component of line segment
...
optional arguments passed to plotting functions.

Details

At each time t, a line segment is drawn to represent the vector from the time axis to (x, y).

Examples

Run this code
library(oce)
t <- seq.POSIXt(from=as.POSIXct("2007-01-01"), to=as.POSIXct("2007-01-30"),
length.out=200)
tt <- as.numeric(t - t[1], units="hours")
u <- cos(tt*2*pi/240)
v <- sin(tt*2*pi/240)
stickplot(t, u, v)

Run the code above in your browser using DataLab