colorbar()
colorbar('off')
colorbar(location)
colorbar(..., propertyName, propertyValue)
colorbar(target, ...)
colorbar(target, 'off')
c = colorbar(...)
| Parameter | Description |
|---|---|
| propertyName | a scalar string or row vector character. |
| propertyValue | a value. |
| target | Target: axes. |
| 'off' | deletes colorbar associated with the current axes. |
| location | location of the colorbar (e.g. 'north','south','east','west', ...). |
| Parameter | Description |
|---|---|
| c | graphics object: axes on color bar. |
colorbar adds a color bar into a plot.
It can be placed at different locations around the axes.
Supported locations include: 'north','south','east','west', 'northoutside','southoutside','eastoutside','westoutside'.
f = figure();
surf(peaks);
axis('square');
colormap('summer');
colorbar()
f = figure();
surf(peaks);
axis('square');
colormap('gray');
cb = colorbar(gca);
locations = { 'north';
'south';
'east';
'west';
'northoutside';
'southoutside';
'eastoutside';
'westoutside'};
f = figure();
surf(peaks);
colormap('jet');
for k = 1 : length(locations)
colorbar(locations{k});
pause(1);
end
| Version | Description |
|---|---|
| 1.0.0 | initial version |
| 1.15.0 | added support for location parameter |