lcolorbar
Colorbar with text labels
Syntax
lcolorbar(labels)
lcolorbar(labels,'property',value,...)
hcb = lcolorbar(...)
Description
lcolorbar(labels)
appends text labels to a colorbar at
the center of each color band. The labels
input argument is specified
as a string array or cell array of character vectors. The number of elements in
labels
must match the length of the colormap.
lcolorbar(labels,'property',value,...)
controls the
properties of the colorbar.
Property | Description |
---|---|
Location | Controls the location of the colorbar. Valid values are 'vertical' (the
default) or 'horizontal' . |
TitleString | Text of title. |
XLabelString | Text of x-label. |
YLabelString | Text of y-label. |
ZLabelString | Text of z-label. |
ColorAlignment | Controls whether the colorbar labels are centered on the color
bands or the color breaks. Valid values are 'center' and 'ends' . |
Other valid property-value pairs are any properties and values that can be applied to the title and labels of the colorbar axes.
hcb = lcolorbar(...)
returns a handle to
the colorbar axes.
Examples
figure colormap(jet(5)) labels = {'blue','cyan','green','yellow','orange'}; lcolorbar(labels,'fontweight','bold');