Plot Image Using Texture Fill
For a factor-valued pixel image, this command plots each level of the factor 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)
- Pixel image (object of class
"im") whose pixel values are a
factorwith at most 8 levels.
- Other arguments passed to
- 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 (
- 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
border=NAto 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
spacingparameter for the textures.
- Textures to be used for each level. Either a texture map (object of
"texturemap") or a vector of integer codes (to be interpreted by
- 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.
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
- (Invisible) A texture map (object of class
"texturemap") associating a texture with each level of the factor.
Z <- cut(setcov(owin()), 3, labels=c("Lo", "Med", "Hi")) textureplot(Z)