This function is a relatively simple wrapper around the usual graphics device with the same name as dev
. The idea is to provide an easy way of creating an image file from a matrix, without axes, plotting frame, labels, etc.
For all choices of dev
except "pdf"
, the output image dimensions are set to match the matrix size, such that each pixel corresponds to an element of the matrix.
If map
is NULL
(the default), the matrix is interpreted as a matrix of colors.
If map
is specified, it is used to translate
the numeric matrix x
into a matrix of colors,
using cmap
.