% Simple example showing a variety of gaussian distributions (as given
% in Kuncheva, p. 27)

n = 100; % # points

% gauss() arguments: number of points, mean vector, covariance matrix.
% Note that the means (vector given as second argument) have been shifted.
G1 = gauss(n, [ 0 15 ], [4 0 ; 0 4 ]);  % [ 4 0 ; 0 4] is a 2x2 matrix, as [ 1st ; 2nd ] row
G2 = gauss(n, [ 15 15 ], [8 0 ; 0 1 ]); 
G3 = gauss(n, [ 0 0 ], [ 4 -4; -4 6 ]);
G4 = gauss(n, [ 15 0 ], [ 4 4 ; 4 6 ]);

% Plot a3 distributions in a single figure:
%  note the 'hold on' commands, which maintain access to the 
%  current figure window.
scatterd(G1,'go');
hold on;
scatterd(G2,'r+');
hold on;
scatterd(G3,'k*');
hold on;
scatterd(G4,'y.');
hold on;
axis([ -20 20 -20 20 ]);
hold off;

% Text labels:
text(0,15,'a.');
text(15,15,'b.');
text(0,0,'c.');
text(15,0,'d.');

% Looking at plots:
%
% Try using the zoom in/out operations to look at the plot.
% Note that the mouse wheel can be used to zoom.
%
% The 'hand' icon will let you move around the plot.

