image(C)
image(x,y,C)
image('PropertyName',PropertyValue,...)
h = image(...)
image
is both a high-level command for displaying images and a low-level function for creating image objects.
Image objects are children of axes objects. MATLAB displays an image by mapping each element in a matrix to an entry in the figure's colormap. The image
function allows you to specify property name/property value pairs as input arguments. These properties, which control various aspects of the image object, are described under "Object Properties." You can also set and query property values after creating the object using the set
and get
commands.
image(C)
displays matrix C
as an image. Each element of C
specifies the color of a rectilinear patch in the image. The elements of C
are used as indices into the current colormap to determine the color.
image(x,y,C)
, where x
and y
are vectors, specifies the bounds of the image data on the x- and y-axes, but produces the same image as image(C)
. The matrix arguments can be followed by property name/property value pairs to specify additional image properties. You can omit the matrix arguments entirely and specify all properties using property name/property value pairs.
h = image('PropertyName',PropertyValue,...)
specifies property name/property value pairs as input arguments.
h = image(...)
returns the handle of the object it creates.
image
and pcolor
are similar, however, there are important differences:
image(C)
:
hold
is not on
(y-axis reversed) pcolor(C)
:
interp
caxis
limits into the colormapimage(C)
is the same as the number of vertices for pcolor(C)
.
ButtonDownFcn
eval
function to execute the specified function. Initially the empty matrix.CData
image(C)
assigns C
to CData
. The elements of CData
are indices into the current colormap, determining the color at each rectilinear patch in the image. Values with a decimal portion are fixed to the nearest, lower integer. Values less than 1 are mapped to the lowest value in the colormap, and values greater than length(colormap)
are mapped to the highest value.Children
Clipping
on
(Default.) Any portion of the image outside the axes rectangle is not displayed.off
Image data is not clipped.Interruptible
yes
The callback specified by ButtonDownFcn
is interruptible by other callbacks.no
(Default.) The ButtonDownFcn
callback is not interruptible.Parent
Type
'image'
for an image object.UserData
get
command.
Visible
on
(Default.) Image is visible on the screen.off
Image is not displayed.XData
CData
are used.YData
CData
are used.
Alternatively, you can read images such as photographs and drawings from external files:colormap(cool)
image(((real(fft(eye(64)))+1)/2)*64)
load earth
colormap(map)
image(X)
colormap
,pcolor
(c) Copyright 1994 by The MathWorks, Inc.