5
我想讓每個子圖共享相同的顏色條比例。我知道caxis
適用於大於1的整數,但使用caxis
時出現問題,例如0.001。Matlab中用散點圖繪製小數字的常用顏色條
x = 0:1:10;
y = 0:1:10;
z1 = .1:-.01:0;
z2 = .01:-.001:0;
figure;
subplot(1,2,1);
scatter(x,y,10,z1); colorbar;
subplot(1,2,2);
scatter(x,y,10,z2); colorbar;
現在我想有散射次要情節有一個共同的彩條的規模。我試圖使用caxis
,但是我沒有得到想要的結果。 左軸不能正確縮放,因爲它們都是棕色的。這怎麼解決?
ca = [0 .01];
figure;
subplot(1,2,1);
scatter(x,y,10,z1); caxis(ca); colorbar;
subplot(1,2,2);
scatter(x,y,10,z2); caxis(ca); colorbar;
這有效!然後,我可以將顏色條上的刻度標籤更改爲「1e-4」等。 – Elpezmuerto 2011-05-09 20:06:29