som_barplane
Purpose
Visualizes the map prototype vectors as bar charts.
Syntax
h = som_barplane(lattice, msize, data)
h = som_barplane(lattice, msize, data, color)
h = som_barplane(lattice, msize, data, color, scaling)
h = som_barplane(lattice, msize, data, color, scaling, gap)
h = som_barplane(lattice, msize, data, color, scaling, gap, pos)
Description
Visualizes the map prototype vectors as bar charts.
Required input arguments
lattice The basic shape of the map units
(string) 'hexa' or 'rect' positions the bar charts according to
hexagonal or rectangular map lattice
msize The size of the map grid
(vector) [n1 n2] vector defines the map size (height: n1 units widht: n2
units, total: M=n1xn2 units). The units will be placed to their
topological locations in order to form a uniform hexagonal or
rectangular grid.
(matrix) Mx2 matrix defines arbitary coordinates for the N units. In
this case the argument 'lattice' has no effect
data The data to use when constructing the bar charts.
Typically, the map codebook or some of its components.
(matrix) Mxd matrix. A row defines heights of the bars.
Optional input arguments
Note: if unspecified or given an empty value ('' or []), default
values are used for optional input arguments.
color The color of the bars in each pie
(ColorSpec) or (string) 'none' gives the same color for each slice.
(matrix) dx3 matrix assigns an RGB color determined by the dth row of
the matrix to the dth bar (variable) in each bar plot.
Default value is hsv(d).
scaling How to scale the values
(string) 'none', 'unitwise' or 'varwise'. This determines the
scaling of codebook values when drawing the bars.
If 'none' is given, the zero value line goes in the middle of
each unit and no scaling is done: the bars are not limited to
remain inside he units' area: That is, if value of some variable
exceeds [-.5,.5] the bar will overlap other units. Zero
line is always in the middle of the unit in this case.
'unitwise' scales values in each unit individually so that the
bars for variables having minimum and maximum values have minimum
and maximum range inside each unit, respectively.
In this case the zero value line may move depending on the values.
'varwise' scales values so that each variable is scaled separately
so that when it gets its overall maximum value, the
corresponding bar gets maximum range and for minimum value
it gets the minimum range. Zero line is always in the middle in this
case. This is the default.
gap The gap between bars
(scalar) 0: no gap: bars are glued together
... default value is 0.25
1: maximum gap: bars are thin lines
pos Position of origin
(vector) size 1x2. This is meant for drawing the plane in arbitrary
location in a figure. Note the operation: if this argument is
given, the axis limits setting part in the routine is skipped and
the limits setting will be left to be done by MATLAB's defaults.
Default is [1 1].
Output arguments
h (scalar) handle to the created patch object
Object tags
One object handle is returned: field Tag is set to 'planeBar'
Features
- The values are linearly scaled in each bar plot (in each map unit)
so that the bars span from the lower to the upper edge in each bar.
That is, the data may have different scaling in each node.
Observe that the zero line may be in different locations in
the nodes.
- The colors are fixed: changing colormap in the figure (see help
colormap) will not change the coloring of the bars.
Examples
%%% Create the data and make a map
data=rand(100,5); map=som_make(data);
%%% Create a 'jet' colormap that has as many rows as the data has variables
colors=jet(5);
%%% Draw bars
som_barplane(map.topol.lattice, map.topol.msize, map.codebook,colors);
%%% Draw the bars so that the gap between the bars is bigger and all
bars are black
som_barplane(map.topol.lattice, map.topol.msize, map.codebook, 'k', 0.6);
See also
som_cplane
| Visualize a 2D component plane, u-matrix or color plane
|
som_plotplane
| Visualize the map prototype vectors as line graphs
|
som_pieplane
| Visualize the map prototype vectors as pie charts
|
[ Help Desk | SOM Toolbox ]