Skip to content

colorbar

plot · scripts/plot/draw/colorbar.m

: colorbar
: colorbar (location)
: colorbar (…, name, value)
: colorbar (target, …)
: colorbar ("off")
: c = colorbar (…)

Add a colour bar to the current (or the given) axes, or remove it.

The bar shows the colormap over the colour limits of the axes. There is at most one bar per axes; calling colorbar again updates it. location is one of "north", "south", "east", "west", "northoutside", "southoutside", "eastoutside" (default) and "westoutside"; inside locations overlay the axes, outside locations shrink them. Name/value pairs set the properties ‘Ticks’, ‘TickLabels’, ‘Limits’, ‘Direction’, ‘Label’, ‘FontSize’, ‘Color’, ‘Visible’ and ‘Tag’ of the bar. target is an axes handle or the handle of a colour bar. "off" (or "hide") deletes the bar.

The result is the bar, of class matlab.graphics.illustration.ColorBar (tag "Colorbar"). Its properties ‘Ticks’, ‘TicksMode’, ‘TickLabels’, ‘TickLabelsMode’, ‘Limits’, ‘LimitsMode’, ‘Direction’, ‘Label’, ‘Location’, ‘AxisLocation’, ‘AxisLocationMode’, ‘TickDirection’ and ‘Color’ can be read and set at any time; setting ‘Location’ moves the bar and lays the axes out again, and setting ‘Position’ makes ‘Location’ "manual".