Change resize algorithm in figure window

Hi,
Does anyone know which resize algorithm matlab is using to represent my data in a limited number of pixels? Is it some flavour of imresize?
Secondly, I would like to change which algorithm is used, any info on that?
(Specifically, I am using imagesc to create a plot, and I am not happy with how the data is represented. But my question is probably not specific to imagesc).

回答 (1 件)

Jan
Jan 2022 年 4 月 1 日
編集済み: Jan 2022 年 4 月 1 日

0 投票

If you mean, how image() resizes the data to match the pixels of the display, see: https://www.mathworks.com/matlabcentral/answers/454161-interpolation-method-of-image

4 件のコメント

Andreas Westlund
Andreas Westlund 2022 年 4 月 1 日
Thanks, but that seems to be another question regarding the same thing, but no answer :)
Jan
Jan 2022 年 4 月 1 日
編集済み: Jan 2022 年 4 月 1 日
The answer of this other question shows, that a nearest neighbor method is applied.
If you want to change it, replace imagesc() by a function, which resizes the image using imresize() using the available pixels in the figure.
Andreas Westlund
Andreas Westlund 2022 年 4 月 1 日
But how do I get this done dynamically, i.e. when zooming in the figure?
Jan
Jan 2022 年 4 月 1 日
You can insert this in the SizeChangedFcn of the figure. Put the original image data in the UserData of the image object. Then apply the reizing whenever the size is changed. This can cause troubles due to the delay. See https://www.mathworks.com/matlabcentral/answers/400382-delay-when-resizing-a-figure-in-r2016b

サインインしてコメントする。

製品

リリース

R2021b

質問済み:

2022 年 4 月 1 日

コメント済み:

Jan
2022 年 4 月 1 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by