function h=som_pieplane(varargin)
%SOM_PIEPLANE Visualize the map prototype vectors as pie charts
%
% h=som_pieplane(lattice, msize, data, [color], [s], [pos])
% h=som_pieplane(topol, data, [color], [s], [pos])
%
% som_pieplane('hexa',[5 5], rand(25,4), jet(4), rand(25,1))
% som_pieplane(sM, sM.codebook);
%
% Input and output arguments ([]'s are optional):
% lattice (string) grid 'hexa' or 'rect'
% msize (vector) size 1x2, defines the grid, M=msize(1)*msize(2)
% (matrix) size Mx2, gives explicit coordinates for each node: in
% this case the lattice does not matter.
% topol (struct) map or topology struct
% data (matrix) size Mxd, Mth row is the data for Mth pie. The
% values will be normalized to have unit sum in each row.
% [color] (matrix) size dx3, RGB triples. The first row is the
% color of the first slice in each pie etc. Default is hsv(d).
% (string) ColorSpec or 'none' gives the same color for each slice.
% [s] (matrix) size Mx1, gives an individual size scaling for each node.
% (scalar) gives the same size for each node. Default is 0.8.
% [pos] (vectors) a 1x2 vector that determines position for the
% origin, i.e. upper left corner. Default is no translation.
%
% h (scalar) the object handle to the PATCH object
%
% The data will be linearly scaled so that its sum is 1 in each unit.
% Negative values are invalid. Axis are set as in som_cplane.
%
% For more help, try 'type som_pieplane' or check out online documentation.
% See also SOM_CPLANE, SOM_PLOTPLANE, SOM_BARPLANE
%%%%%%%%%%%%% DETAILED DESCRIPTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% som_pieplane
%
% PURPOSE
%
% Visualizes the map prototype vectors as pie charts.
%
% SYNTAX
%
% h = som_pieplane(topol, data)
% h = som_pieplane(lattice, msize, data)
% h = som_pieplane(..., color)
% h = som_pieplane(..., color, s)
% h = som_pieplane(..., color, s, pos)
%
% DESCRIPTION