For a factor-valued pixel image, this command plots each level of the factor using a different texture. For a tessellation, each tile is plotted using a different texture.
textureplot(x, ...,
main, add=FALSE, clipwin=NULL, do.plot = TRUE,
border=NULL, col = NULL, lwd = NULL, lty = NULL, spacing = NULL,
textures=1:8,
legend=TRUE,
leg.side=c("right", "left", "bottom", "top"),
legsep=0.1, legwid=0.2)
(Invisible) A texture map (object of class "texturemap"
)
associating a texture with each level of the factor.
A tessellation (object of class "tess"
or something
acceptable to as.tess
) with at most 8 tiles,
or a pixel image (object of class "im"
or something
acceptable to as.im
) whose pixel values
are a factor
with at most 8 levels.
Other arguments passed to add.texture
.
Character string giving a main title for the plot.
Logical value indicating whether to draw on
the current plot (add=TRUE
) or to initialise a new plot
(add=FALSE
).
Optional. A window (object of class "owin"
).
Only this subset of the image will be displayed.
Logical. Whether to actually do the plot.
Colour for drawing the boundaries between the different regions.
The default (border=NULL
) means to use par("fg")
.
Use border=NA
to omit borders.
Numeric value or vector giving the colour or colours in which the textures should be plotted.
Numeric value or vector giving the line width or widths to be used.
Numeric value or vector giving the line type or types to be used.
Numeric value or vector giving the spacing
parameter
for the textures.
Textures to be used for each level. Either a texture map (object of
class "texturemap"
) or a vector of integer codes
(to be interpreted by add.texture
).
Logical. Whether to display an explanatory legend.
Position of legend relative to main plot.
Separation between legend and main plot, as a fraction of the shortest side length of the main plot.
Width (if vertical) or height (if horizontal) of the legend as a fraction of the shortest side length of the main plot.
Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk.
If x
is a tessellation, then each tile of the tessellation is
plotted and filled with a texture using add.texture.
If x
is a factor-valued pixel image, then
for each level of the factor, the algorithm finds the region where the image
takes this value, and fills the region with a texture using
add.texture
.
im
,
plot.im
,
add.texture
.
nd <- if(interactive()) 128 else 32
Z <- setcov(owin(), dimyx=nd)
Zcut <- cut(Z, 3, labels=c("Lo", "Med", "Hi"))
textureplot(Zcut)
textureplot(dirichlet(runifrect(6)))
Run the code above in your browser using DataLab