Plot a representation of a texture map, similar to a plot legend.
# S3 method for texturemap
plot(x, ..., main, xlim = NULL, ylim = NULL,
vertical = FALSE, axis = TRUE,
labelmap = NULL, gap = 0.25,
spacing = NULL, add = FALSE)
Null.
Texture map object (class "texturemap"
).
Additional graphics arguments passed to
add.texture
or axis.default
.
Main title for plot.
Optional vectors of length 2 giving the \(x\) and \(y\) limits of the plot.
Logical value indicating whether to arrange the texture boxes
in a vertical column (vertical=TRUE
or a horizontal row
(vertical=FALSE
, the default).
Logical value indicating whether to plot an axis line joining the texture boxes.
Optional. A function
which will be applied to the
data values (the inputs of the texture map) before they are
displayed on the plot.
Separation between texture boxes, as a fraction of the width or height of a box.
Argument passed to add.texture
controlling the density
of lines in a texture. Expressed in spatial coordinate units.
Logical value indicating whether to add the graphics to an existing
plot (add=TRUE
) or to initialise a new plot
(add=FALSE
, the default).
Adrian Baddeley Adrian.Baddeley@curtin.edu.au
Rolf Turner r.turner@auckland.ac.nz
and Ege Rubak rubak@math.aau.dk
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
.
texturemap
,
textureplot
,
add.texture
.
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