persp.im
From spatstat v1.25-1
by Adrian Baddeley
Perspective Plot of Pixel Image
Displays a perspective plot of a pixel image.
Usage
## S3 method for class 'im':
persp(x, \dots, colmap=NULL)
Arguments
- x
- The pixel image to be plotted.
An object of class
"im"
(seeim.object
). - ...
- Extra arguments passed to
persp.default
to control the display. - colmap
- Optional data controlling the colour map. See Details.
Details
This is the persp
method for the class "im"
.
The pixel image x
must have real or integer values.
These values are treated as heights of a surface, and the
surface is displayed as a perspective plot on the current plot device,
using equal scales on the x
and y
axes.
The optional argument colmap
gives an easy way to display
different altitudes in different colours (if this is what you
want).
- If
colmap
is a colour map (object of class"colourmap"
, created by the functioncolourmap
) then this colour map will be used to associate altitudes with colours. - If
colmap
is a character vector, then the range of altitudes in the perspective plot will be divided intolength(colmap)
intervals, and those parts of the surface which lie in a particular altitude range will be assigned the corresponding colour fromcolmap
. - If
colmap
is a list with entriesbreaks
andcol
, thencolmap$breaks
determines the breakpoints of the altitude intervals, andcolmap$col
provides the corresponding colours.
...
arguments
directly to the function persp.default
.
See the examples in persp.default
or in
demo(persp)
.
Value
- Returns the 3D transformation matrix
returned by
persp.default
.
See Also
Examples
# an image
Z <- setcov(owin())
persp(Z, colmap=terrain.colors(128))
co <- colourmap(range=c(0,1), col=rainbow(128))
persp(Z, colmap=co, axes=FALSE, shade=0.3)
Community examples
Looks like there are no examples yet.