imagesc

I = imagesc(mat; x=, y=, hdr=, proj4=, wkt=, GI=, clim=, cmap=, kw...) --> GMTimage

imagesc takes a Float matrix or a GMTgrid type and scales it (by default) to the [0, 255] interval. In the process it creates a GMTimage type. Those types can account for coordinates and projection information, hence the optional arguments. Contrary to its Matlab cousin, it doesn’t display the result (that we easily do with imshow(mat)) but return instead a GMTimage object.

If mat is instead a UInt16 GMTimage type we call rescale(I, stretch=true, type=UInt8) instead of issuing an error. In this case clim can be a two elements vector to specify the desired stretch range. The default is to let histogram guess these values.

Examples

Create a grayscale image out of the peaks function.

using GMT

viz(imagesc(GMT.peaks()))

See Also

grdimage, grdview, rescale