Control output resolution montage R2018b and later
17 次查看(过去 30 天)
显示 更早的评论
I'm using the montage function on two different versions of matlab: R2018b and R2017a. The function appears to function differently!
% im4d is a matrix of size 750 by 750 by 1 by 133
h = montage(im4d);
In R2017a, the montage produced is 'full resolution' - the size of h.CData is 9000 by 9000
In R2018b, the montage produced is 'low resolution' - the size of h.CData is 1200 by 1200
I noticed the imtile function in >=R2018b, but I'd like to use the same code for both/all recent-ish versions of Matlab. How do I do this? Is there a way to specify the 'output' size/res in montage?
Edit: I should add, I'd like to use this code in a function, so im4d could be any size. I was thinking that it might be possible to set the size of the parrent axes to have a size of what the montage would be: I'd assume that I'd need to create axes with a certain size before calling montage but how do I know what would be the right size?
0 个评论
回答(1 个)
Raunak Gupta
2020-3-19
Hi,
The above functionality of Resolution change can be achieved using ‘ThumbnailSize’ property of montage function. Since this functionality was not available in R2017a the figure was plotted with all the data. Right now, if you don’t specify the ‘ThumbnailSize’, montage will resize the image to that of the size of screen.
Since you want predictability while plotting the montage, I suggest adding the ‘ThumbnailSize’. ‘ThumbnailSize’ is the size of each image plotted from the image sequence. If you want custom size mention ‘ThumbnailSize’ as a two element vector otherwise if you want aspect ratio of first image to be maintained then mentioned ‘ThumbnailSize’ as
[number of pixel in one dimension, Inf]
This will rescale each image accordingly. Also, if you want full resolution image mention ‘ThumnailSize’ as [ ]. Also Note that the montage arranges the number of images such that full figure nearly form a square. If you want custom shape, try setting the ‘Size’ field too.
Hope this clarify each of your doubt.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Install Products 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!