0

Matlab で生成されたデフォルトのカラー バー (ジェット カラー)、特に色のステップを変更したい (下図のように)。どうやってするか?

これが私のコードです

[hC hC] = contourf(interp2(sal,2,'spline'),[0:0.5:5]);
set(hC,'LineStyle','none','YTick',0:4);
colorbar;

ここに画像の説明を入力

4

2 に答える 2

0

You can adjust the color bar properties by using:

c=colorbar;
c.Ticks=[vector of tick locations]

or alternately you could try

c.Limits=[min max]

See the MATLAB documentation for colorbar properties: http://www.mathworks.com/help/matlab/ref/colorbar-properties.html?refresh=true

this explains color bar customization in more detail

于 2015-07-14T02:21:56.520 に答える