Why is saveas() changing my image aspect ratio?
3 ビュー (過去 30 日間)
古いコメントを表示
I'm trying to save a figure as a PNG but the aspect ratio changes for some reason.
This is how it looks in MATLAB:
This is how it looks when I save it (slightly elongated as you can see):
How can I fix this?
g = figure;
subplot(1,2,1)
imagesc(im1);
subplot(1,2,2)
imagesc(im2);
g.WindowState = 'maximized'; % this didn't work
saveas(g, name, "png");
0 件のコメント
回答 (2 件)
Eamon Gekakis
2022 年 6 月 17 日
The exportgraphics function may be useful here, 'Resolution' is available as a name-value pair input argument.
参考
カテゴリ
Help Center および File Exchange で Read, Write, and Modify Image についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!