torusAxis3d: Draws pretty axis labels for circular variables

View source: R/auxiliary.R

torusAxis3dR Documentation

Draws pretty axis labels for circular variables

Description

Wrapper for drawing pretty axis labels for circular variables. To be invoked after plot3d with axes = FALSE and box = FALSE has been called.

Usage

torusAxis3d(sides = 1:3, twoPi = FALSE, ...)

Arguments

sides

an integer vector specifying which side of the plot the axes are to be drawn on. The axes are placed as follows: 1 = x, 2 = y, 3 = z.

twoPi

flag indicating that [0,2\pi) is the support, instead of [-\pi,\pi).

...

further parameters passed to axis3d.

Details

The function calls box3d.

Value

This function is usually invoked for its side effect, which is to add axes to an already existing plot.

Examples


if (requireNamespace("rgl")) {
  n <- 50
  x <- toPiInt(rnorm(n, mean = seq(-pi, pi, l = n), sd = 0.5))
  y <- toPiInt(rnorm(n, mean = seq(-pi, pi, l = n), sd = 0.5))
  z <- toPiInt(x + y + rnorm(n, mean = seq(-pi, pi, l = n), sd = 0.5))
  rgl::plot3d(x, y, z, xlim = c(-pi, pi), ylim = c(-pi, pi),
              zlim = c(-pi, pi), col = rainbow(n), size = 2,
              box = FALSE, axes = FALSE)
  torusAxis3d()
}


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