Learn R Programming

SciencesPo (version 1.02.12)

perspBox: Create an Empty Persp Plot

Description

Creates an empty persp plot objtect.

Usage

perspBox(x1, x2, y, x1lab = "x1", x2lab = "x2", ylab = "y", x1lim, x2lim,
  ...)

Arguments

x1
data for the first horizontal axis, an R vector
x2
data for the second horizontal axis, an R vector
y
data for the vertical axis, an R vector
x1lab
label for the x1 axis, (the one called "xlab" inside persp)
x2lab
label for the x2 axis, (the one called "ylab" inside persp)
ylab
label for the y (vertical) axis (the one called "zlab" inside persp)
x1lim
Optional: limits for x1 axis (should be a vector with 2 elements)
x2lim
Optional: limits for x2 axis (should be a vector with 2 elements)
...
further arguments that are passed to persp, including xlab, ylab, zlab, xlim, ylim, and zlim are going to be ignored.

Value

  • The perspective matrix that is returned by persp

Examples

Run this code
x1 <- 1:10
x2 <- 41:50
y <-  rnorm(10)
perspBox(x1, x2, y)
box <- perspBox(x1, x2, y, ticktype = "detailed", nticks=10)
mypoints1 <- trans3d( x1, x2, y, pmat = box )
points(mypoints1, pch = 16, col= "blue")

Run the code above in your browser using DataLab