Learn R Programming

geophys (version 1.2-1)

PLOTbox: Plot 3D box

Description

Plot 3D box

Usage

PLOTbox(Rax, Rbox, axcol = "black", boxcol = "blue")

Arguments

Rax
rotated axes
Rbox
rotated box
axcol
axes color
boxcol
box color

Value

  • Graphical Side effects

See Also

pstart, PLOTplane, stress, NORMvec

Examples

Run this code
#######    set colors
 axcol = 'black'
 boxcol = 'blue'
 planecol = 'brown'

####   view angle
 Rview  =    ROTZ(-130)
###   set arbitrary scale
    xscale = 100


###   create box  and scale it
   BOX <-matrix(c(0,0,0,0,
            0, 1, 0,0,
            0, 1, 1,0,
            0, 0, 1,0,
            1,0,0,0,
            1, 1, 0,0,
            1, 1, 1,0,
            1, 0, 1,0), ncol=4, byrow=TRUE)


    BOX = xscale*BOX

    ##############   create axes and scale them
AX = matrix(c(0,0,0,0,
            1, 0, 0,0,
            0, 0, 0,0,
            0, 1, 0,0,
            0,0,0,0,
            0, 0, 1,0), ncol=4, byrow=TRUE)

    AX = 1.5*xscale*AX

 ##############   rotate axes and box
    Rax =  AX
    
          Rbox =   BOX
 ##############  start the figure
pstart(xscale=xscale)
 ######  plot the box
PLOTbox(Rax, Rbox, axcol= 'black', boxcol= 'blue')

Run the code above in your browser using DataLab