Adjust display size of image
truesize( adjusts the display size
such that each image pixel covers one screen pixel.
If you do not specify a figure,
truesize adjusts the display
size of the current figure.
Adjust Display Size of Image
Create a default checkerboard image, which has size 80-by-80 pixels. Display the checkerboard image to fill the full size of the figure window. The image is magnified to fill the window.
c = checkerboard; imshow(c,'InitialMagnification','fit')
Display the checkerboard image so that each image pixel covers one screen pixel.
You can adjust the size of the figure window to arbitrary dimension. The image scales to fit within the figure window.
fig — Figure
gcf (default) | figure handle
Figure containing a single image or a single image with a color bar,
specified as a figure handle. By default,
the current figure, with handle
[mrows ncols] — Screen dimensions
2-element numeric row vector
Screen dimensions (in pixels) that the image should occupy, specified as a
2-element numeric row vector. By default,
is equal to the image size, so each image pixel covers one screen
Introduced before R2006a