gpt4 book ai didi

image - imshow 更新的问题

转载 作者:太空宇宙 更新时间:2023-11-03 20:30:21 27 4
gpt4 key购买 nike

为什么图中的图像(由 imshow 绘制)在被另一个 imshow 更新时会改变其大小?

演示代码:

img = rand(100,100);
figure(1);
hold on;
imshow(img); % plot an image
pause(1); % pause for demonstrational reasons
imshow(img); % update the image

这只发生在第一次更新时。

最佳答案

图(1);采用默认大小,然后当您绘制 imshow(img) 后,保持大小相对于先前的图形 (1) 大小减小。

更好的方法是

img = rand(100,100);
figure, imshow(img); % plot an image
hold on;
pause(1); % pause for demonstrational reasons
imshow(img); % update the image

关于image - imshow 更新的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18204484/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com