Learn R Programming

spatstat (version 1.20-2)

plot.colourmap: Plot a Colour Map

Description

Displays a colour map as a colour ribbon

Usage

## S3 method for class 'colourmap':
plot(x, ...,
       main, xlim = NULL, ylim = NULL, vertical = FALSE, axis = TRUE)

Arguments

x
Colour map to be plotted. An object of class "colourmap".
...
Graphical arguments passed to image.default.
main
Main title for plot. A character string.
xlim
Optional range of x values for the location of the colour ribbon.
ylim
Optional range of y values for the location of the colour ribbon.
vertical
Logical flag determining whether the colour ribbon is plotted as a horizontal strip (FALSE) or a vertical strip (TRUE).
axis
Logical flag determining whether an axis should be plotted showing the numerical values that are mapped to the colours.

Value

  • None.

Details

This is the plot method for the class "colourmap". An object of this class (created by the function colourmap) represents a colour map or colour lookup table associating colours with each data value.

The command plot.colourmap displays the colour map as a colour ribbon. This plot can be useful on its own to inspect the colour map.

To annotate an existing plot with an explanatory colour ribbon, specify add=TRUE and use the arguments xlim and/or ylim to control the physical position of the ribbon on the plot.

See Also

colourmap

Examples

Run this code
co <- colourmap(rainbow(100), breaks=seq(-1,1,length=101))
  plot(co)
  plot(co, vertical=TRUE)
  ca <- colourmap(rainbow(8), inputs=letters[1:8])
  plot(ca)

Run the code above in your browser using DataLab