function layoutplot(cfg);

% LAYOUTPLOT plots the layout of the channel positions for topoplotting
% and the individual channel axes for multiplotting
%
% Use as
%   layoutplot(cfg)
% where the configuration contains
%   cfg.layout        = specification of the layout, see below
%
% The layout defines how the channels are arranged. You can specify the
% layout in a variety of ways:
%  - you can give the name of an ascii layout file with extension *.lay
%  - you can give the name of an electrode file
%  - you can give an electrode definition, i.e. "elec" structure
%  - you can give a gradiometer definition, i.e. "grad" structure
%
% See also topoplotER, topoplotTFR, multiplotER, multiplotTFR

% Copyright (C) 2006, Robert Oostenveld
%
% $Log$

lay = createlayout(cfg.layout);

X      = lay.prj(:,1);
Y      = lay.prj(:,2);
Width  = lay.box(:,1);
Height = lay.box(:,2);
Lbl    = lay.label;
figure
plot(X, Y, '.');
text(X, Y, Lbl);
line([X X+Width X+Width X X]',[Y Y Y+Height Y+Height Y]');

