How can I make use of the full window size when zooming into very tall images?
Ältere Kommentare anzeigen
When zooming into an image with a hight aspect ratio (heigth much larger than its width), the displayed image is constrained to the area that was used with the original imshow command and the rest of the window remains unused. How can I make use of the full window size?
Example (normally imtall would be a linescan camera image of size 10000 by 512 pixels but this demonstrates my problem pretty well):
im=imread('cameraman.tif');
imtall=repmat(im,11,1); % size 2816 by 256
imshow(imtall)
zoom(10)
There would be enough space to the left and right side in the window to display the full cameraman:

Akzeptierte Antwort
Weitere Antworten (2)
Mathieu NOE
am 21 Dez. 2025
hello
you can try this :
% Example data
im=imread('cameraman.tif');
imtall=repmat(im,11,1); % size 2816 by 256
imshow(imtall)
zoom(10)
% Maximize width: fit X-axis to data range
[y,x,~] = size(imtall);
xlim([1 x]);
% % Optional: make figure fill screen
% set(gcf, 'Units', 'normalized', 'OuterPosition', [0 0 1 1]);
1 Kommentar
RalfW
am 21 Dez. 2025
Tim Jackman
am 10 Jan. 2026
0 Stimmen
Another option to consider is imageshow, which is an image display function built specifically for large images. It will expand to fill the figure viewport as you zoom in:
im=imread('cameraman.tif');
imtall=repmat(im,11,1);
imageshow(imtall)
Kategorien
Mehr zu Display Image finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!