Learn R Programming

spatstat (version 1.56-1)

plot.texturemap: Plot a Texture Map

Description

Plot a representation of a texture map, similar to a plot legend.

Usage

# S3 method for texturemap
plot(x, …, main, xlim = NULL, ylim = NULL,
                           vertical = FALSE, axis = TRUE,
                           labelmap = NULL, gap = 0.25,
                           spacing = NULL, add = FALSE)

Arguments

x

Texture map object (class "texturemap").

Additional graphics arguments passed to add.texture or axis.default.

main

Main title for plot.

xlim,ylim

Optional vectors of length 2 giving the \(x\) and \(y\) limits of the plot.

vertical

Logical value indicating whether to arrange the texture boxes in a vertical column (vertical=TRUE or a horizontal row (vertical=FALSE, the default).

axis

Logical value indicating whether to plot an axis line joining the texture boxes.

labelmap

Optional. A function which will be applied to the data values (the inputs of the texture map) before they are displayed on the plot.

gap

Separation between texture boxes, as a fraction of the width or height of a box.

spacing

Argument passed to add.texture controlling the density of lines in a texture. Expressed in spatial coordinate units.

add

Logical value indicating whether to add the graphics to an existing plot (add=TRUE) or to initialise a new plot (add=FALSE, the default).

Value

Null.

Details

A texture map is an association between data values and graphical textures. An object of class "texturemap" represents a texture map. Such objects are returned from the plotting function textureplot, and can be created directly by the function texturemap.

This function plot.texturemap is a method for the generic plot for the class "texturemap". It displays a sample of each of the textures in the texture map, in a separate box, annotated by the data value which is mapped to that texture.

The arrangement and position of the boxes is controlled by the arguments vertical, xlim, ylim and gap.

See Also

texturemap, textureplot, add.texture.

Examples

Run this code
# NOT RUN {
   tm <- texturemap(c("First", "Second", "Third"), 2:4, col=2:4)
   plot(tm, vertical=FALSE)
   ## abbreviate the labels
   plot(tm, labelmap=function(x) substr(x, 1, 2))
# }

Run the code above in your browser using DataLab