colorbar
Turns the axes colorbar on/off. Get and set the colorbar's minimum and maximum values.
Syntax
colorbar()
colorbar(hAxes)
colorbar('on')
colorbar('off')
colorbar(hAxes, 'on')
colorbar(hAxes, 'off')
colorbar([c_lo c_hi])
colorbar(hAxes, [c_lo c_hi])
[c_lo c_hi] = colorbar()
[c_lo c_hi] = colorbar(hAxes)
Inputs
- hAxes
- Handle of the axes.
- on/off
- Determines if the colorbar is visible or not.
- c_lo, c_hi
- Lowest and highest ranges.
Outputs
- c_lo, c_hi
- Current range of the colorbar.
Example
cla;
x=[0:0.1:2*pi];
y=x;
z=sin(x')*cos(y);
contour3(z);
colorbar();
cla;
x=[0:0.1:2*pi];
y=x;
z=sin(x')*cos(y);
contour3(z);
colorbar([-0.5 0.5]);
Comments
c_lo, c_hi specify the values assigned to the first and last color in the colormap. Data values lower or higher than c_lo/c_hi will be assigned the lowest/highest color of the colormap, respectively.