Learn R Programming

spatstat (version 1.11-4)

plot.im: Plot a Pixel Image

Description

Plot a pixel image.

Usage

## S3 method for class 'im':
plot(x, \dots, ribbon=TRUE, ribsep=0.15, ribwid=0.05, ribn=1024)

Arguments

x
The pixel image to be plotted. An object of class "im" (see im.object).
...
Extra arguments passed to image to control the plot.
ribbon
Logical flag indicating whether to display a ribbon showing the colour map.
ribsep
Factor controlling the space between the ribbon and the image.
ribwid
Factor controlling the width of the ribbon.
ribn
Number of different values to display in the ribbon.

Value

  • none.

Details

This is the plot method for the class "im". [It is also the image method for "im".]

The pixel image x is displayed on the current plot device, using equal scales on the x and y axes.

If ribbon=TRUE, a legend will be plotted at the right of the image. The legend consists of a colour ribbon and an axis with tick-marks, showing the correspondence between the pixel values and the colour map.

Arguments ribsep, ribwid, ribn control the appearance of the ribbon. The width of the ribbon is ribwid times the size of the pixel image, where `size' means the larger of the width and the height. The distance separating the ribbon and the image is ribsep times the size of the pixel image. The ribbon contains ribn different numerical values, evenly spaced between the minimum and maximum pixel values in the image x, rendered according to the chosen colour map. Graphical parameters controlling the display of both the pixel image and the ribbon are passed through the ... arguments directly to the function image.default. In particular, the colour map is controlled by the argument col. See the examples in image.default.

To suppress the axis tick marks and labels, set axes=FALSE.

See Also

im.object, contour.im, persp.im

Examples

Run this code
# an image
   Z <- setcov(owin())
   plot(Z)
   plot(Z, col=terrain.colors(128), axes=FALSE)

Run the code above in your browser using DataLab