考虑以下代码
x = [-1:0.1:1];
subplot(2,2,1)
imagesc(x,x,abs(x)/100)
colorbar
subplot(2,2,2)
imagesc(x,x,abs(x))
colorbar
我想要发生什么这两个图像是否会在相同的颜色范围内,并且相同的颜色条,即左侧将大部分为蓝色,而右侧将显示完整的颜色条规模。
答案 0 :(得分:1)
编辑:使范围适合两者。
x = [-1:0.1:1];
subplot(1,2,2)
imagesc(x,x,abs(x))
colorbar
c2 = caxis;
subplot(1,2,1)
imagesc(x,x,abs(x)/100)
colorbar
c1 = caxis;
c3 = [min([c1 c2]), max([c1 c2])];
caxis(c3)
subplot(1,2,2)
colorbar off