Learn R Programming

compositions (version 2.0-4)

axis3D: Drawing a 3D coordiante system to a plot, based on package rgl

Description

Adds a coordinate system to a 3D rgl graphic. In future releases, functionality to add tickmarks will be (hopefully) provided. Now, it is just a system of arrows giving the directions of the three axes.

Usage

axis3D(axis.origin=c(0,0,0),axis.scale=1,axis.col="gray",vlabs=c("x","y","z"),
       vlabs.col=axis.col,bbox=FALSE,axis.lwd=2,axis.len=mean(axis.scale)/10,
       axis.angle=30,orth=c(1,0.0001,0.000001),axes=TRUE,...)

Value

Nothing

Arguments

axis.origin

The location where to put the origin of the coordinate arrows typicall either 0, the minimum or the mean of the dataset

axis.scale

either a number or a 3D vector giving the length of the arrows for the axis in the coordiantes of the plot

axis.col

Color to plot the coordinate system

vlabs

The names of the axes, plotted at the end

vlabs.col

color for the axes labels

bbox

boolean, whether to plot a bounding box

axis.lwd

line width of the axes

axis.angle

angle of the arrow heads

axis.len

length of the arrow heads

orth

the orth argument of arrows3D

axes

a boolean, wether to plot the axes

...

these arguments are passed to arrows3D as rgl::rgl.material arguments

Author

K.Gerald v.d. Boogaart http://www.stat.boogaart.de

Details

The function is called to plot a coordiante system consisting of arrows into an rgl plot.

See Also

rgl::points3d, graphics::plot, plot3D,arrows3D

Examples

Run this code
x <- cbind(rnorm(10),rnorm(10),rnorm(10))
if(requireNamespace("rgl", quietly = TRUE)) {
  plot3D(x)
  x0 <- x*0
  axis3D()
} ## this function requires package 'rgl'

Run the code above in your browser using DataLab