display: Display a 2D image
Description
This function displays a 2D greyscale image. It is a wrapper around image, with more sensible defaults for images. It is (S3) generic.Usage
display(x, ...)## S3 method for class 'default':
display(x, transpose = TRUE, useRaster = TRUE, add = FALSE, ...)
Arguments
x
An object that can be coerced to a numeric matrix.
transpose
Whether to transpose the matrix before display. This is usually necessary due to the conventions of image.
useRaster
Whether to use raster graphics if possible. This is generally preferred for speed. Passed to image.
add
Whether to add the image to an existing plot.
...
Additional arguments to image.
Value
- This function is called for its side-effect of displaying an image on a new R device.
Details
Relative to the defaults for image (from the graphics package), this function transposes and then inverts the matrix along the y-direction, uses a grey colour scale, fills the entire device with the image, and tries to size the image correctly given the dot pitch of the display. Unfortunately the latter is not always possible, due to downstream limitations.