linesTorus: Lines and arrows with wrapping in the torus

Description Usage Arguments Details Value Examples

View source: R/auxiliary.R

Description

Joins the corresponding points with line segments or arrows that exhibit wrapping in [-π,π) in the horizontal and vertical axes.

Usage

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

Arguments

x

vector with horizontal coordinates, wrapped in [-π,π).

y

vector with vertical coordinates, wrapped in [-π,π).

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

x and y are wrapped to [-π,π) before plotting.

Value

Nothing. The functions are called for drawing wrapped lines.

Examples

1
2
3
4
5
6
7
8
x <- toPiInt(rnorm(50, mean = seq(-pi, pi, l = 50), sd = 0.5))
y <- toPiInt(x + rnorm(50, mean = seq(-pi, pi, l = 50), sd = 0.5))
plot(x, y, xlim = c(-pi, pi), ylim = c(-pi, pi), col = rainbow(length(x)),
     pch = 19)
linesTorus(x = x, y = y, col = rainbow(length(x)), ltyCross = 2)
plot(x, y, xlim = c(-pi, pi), ylim = c(-pi, pi), col = rainbow(length(x)),
     pch = 19)
linesTorus(x = x, y = y, col = rainbow(length(x)), arrows = TRUE)

sdetorus documentation built on Aug. 19, 2021, 9:06 a.m.