linesCirc: Lines and arrows with vertical wrapping

View source: R/auxiliary.R

linesCircR Documentation

Lines and arrows with vertical wrapping

Description

Joins the corresponding points with line segments or arrows that exhibit wrapping in [-\pi,\pi) in the vertical axis.

Usage

linesCirc(x = seq_along(y), y, col = 1, lty = 1, ltyCross = lty,
  arrows = FALSE, ...)

Arguments

x

vector with horizontal coordinates.

y

vector with vertical coordinates, wrapped in [-\pi,\pi).

col

color vector of length 1 or the same length of x and y.

lty

line type as in par.

ltyCross

specific line type for crossing segments.

arrows

flag for drawing arrows instead of line segments.

...

further graphical parameters passed to segments or arrows.

Details

y is wrapped to [-\pi,\pi) before plotting.

Value

Nothing. The functions are called for drawing wrapped lines.

Examples

x <- 1:100
y <- toPiInt(pi * cos(2 * pi * x / 100) + 0.5 * runif(50, -pi, pi))
plot(x, y, ylim = c(-pi, pi))
linesCirc(x = x, y = y, col = rainbow(length(x)), ltyCross = 2)
plot(x, y, ylim = c(-pi, pi))
linesCirc(x = x, y = y, col = rainbow(length(x)), arrows = TRUE)

egarpor/sdetorus documentation built on March 4, 2024, 1:23 a.m.