Matlab - 自动设置imagesc中的比例尺

3
我正在尝试比较由Matlab imagesc创建的图形,因此需要让颜色限制与较高值相同。
我试着查找,但无法找到一个简单的方法来做到这一点,或者至少不用打开颜色映射编辑器就能确定限制。
非常感谢您的任何帮助!
阿隆。

请包含一些代码以展示你尝试过什么 - Serge Belov
2个回答

2

您可以使用caxis设置颜色刻度的限制。

img1 = randn(100);
img2 = rand(100);

%# find global min/max
clim(1) = min(min(img1(:)),min(img2(:)));
clim(2) = max(max(img1(:)),max(img2(:)));

figure
ah1 = axes;
imagesc(img1)
caxis(ah1,clim)

%# show the other figure set the same limits to colormap
figure
ah2 = axes
imagesc(img2);
caxis(ah2,clim)

0
imagesc(name_of_your_matrix,[0 255]);

此代码可以显示您的图像并使用 [0 255] 的强度范围进行缩放。当然,您也可以增加它以显示更多颜色。

希望这有所帮助。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接