2014-04-12 295 views
1

我想要具有特定範圍的彩條。我嘗試以下matlab中顏色條的顏色的自定義範圍?

h = colorbar(); 
set(h, 'ylim', [0 60]); 

enter image description here

我想具有最高值的顏色在40是在60中的彩條(拉伸爲的顏色範圍),並且在彩條中值40的顏色應該是圖中的最大值。

回答

1

之前colorbar使用功能caxis你想要的限制,例如,

surf(meshgrid(0:7).^2) 
caxis([0, 60]) 
colorbar 

enter image description here