How can I make use of the full window size when zooming into very tall images?
古いコメントを表示
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:

採用された回答
その他の回答 (2 件)
Mathieu NOE
2025 年 12 月 21 日
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]);
Tim Jackman
2026 年 1 月 10 日
0 投票
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)
カテゴリ
ヘルプ センター および File Exchange で Display Image についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!