Learn R Programming

sdetorus (version 0.1.10)

torusAxis3d: 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, ...)

Value

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

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.

Examples

Run this code
# \donttest{
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()
}
# }

Run the code above in your browser using DataLab