som_recolorbar
Purpose
Refreshes the the colorbars in the figure.
Syntax
h = som_recolorbar
h = som_recolorbar(p)
h = som_recolorbar(p, ticks)
h = som_recolorbar(p, ticks, scaling)
h = som_recolorbar(p, ticks, scaling, labels)
Description
This function refreshes the colorbars in the figure created by SOM_SHOW.
Refreshing is necessary if you have changed the colormap.
Each colorbar may have letters 'u' and/or 'd' as label. Letter 'd' means
that the scale is denormalized and 'u' is for user specified labels.
Different argument combinations:
1. Argument 'ticks' has string values:
- 'auto' for input argument ticks sets the automatic tick
marking on (factory default).
- 'border' sets the tick marks to the color borders. This is
convenient if there are only few colors in use.
Argument scale controls the scaling of the tick mark label values.
'normalized' means that the tick mark labels are directly the values
of the ticks, that is, they refer to the map codebook values.
Value 'denormalized' scales the tick mark label values back to the original
data scaling. This is made using som_denormalize_data.
2. Argument 'ticks' is a cell array of vectors:
The values are set to be the tick marks to the colorbar specified by p.
- if arg. scale is 'normalized' the ticks are set directly to the colorbar.
- if arg. scale is 'denormalized' the tick values are first normalized
in the same way as the data.
Argument 'labels' specify user defined labels to the tick marks
NOTE: ticks are rounded to contain three significant digits.
Optional input arguments
p (vector) subplot number vector
(string) 'all' (the default)
ticks (string) 'auto' or 'border', default: 'auto'
(cell array) p x 1 cell array of p row vectors
scale (string) 'denormalized' or 'normalized' (the default)
labels (cell array) p x 1 cell array of cells containing strings
Output arguments
h (vector) handles to the colorbar objects.
Example
colormap(jet(5)); som_recolorbar('all','border','denormalized')
% Uses five colors and sets the ticks on the color borders.
% Tick label values are denormalized back to the original data scaling
colormap(copper(64));som_recolorbar
% changes to colormap copper and resets default ticking and labeling
som_recolorbar([1 3],{[0.1 0.2 0.3];[0.2 0.4]},'denormalized')
% Ticks colorbar 1 by first normalizing values 0.1, 0.2, 0.3 and
% then setting the ticks to the colorbar. Labels are of course
% 0.1, 0.2 and 0.3. Ticks colorbar 3 in the same way using values
% 0.2 and 0.4.
som_recolorbar([2 4],{[0.1 0.2];[-1.2 3]},'normalized',{{'1' '2'};{'a' 'b'}})
% Ticks colorbar 2 and 4 directly to the specified values. Sets labels
% '1' '2' and 'a' 'b' to the ticks.
som_recolorbar([2 4],{[0.1 0.2];[-1.2 3]},'normalized',{{'1' '2'};{'a' 'b'}})
% as previous one, but normalizes tick values first
See also
[ Help Desk | SOM Toolbox ]