
% Visualize Fisher IRIS Data 
% Produces figures: fisheriris1.eps, fisheriris2.eps, fisherlengths.eps

close all
clear all
lw = 3;  
set(0, 'DefaultAxesFontSize', 17);
fs = 16;
msize = 10;


load fisheriris
s1 = meas(1:50, 1);             %setosa, sepal length
s2 = meas(51:100, 1);         %versicolor, sepal length
s3 = meas(101:150, 1);       %virginica, sepal length
s = [s1 s2 s3];
figure(1)
imagesc(meas)
% print -depsc 'fisheriris1.eps'
 figure(2)
 boxplot(s,'notch','on',...
        'labels',{'setosa','versicolor','virginica'})
 hcc = get(get(gca,'Children'),'Children');
 h1 = findobj(hcc,'type','text');
%  Some graphics comments by Pekka Kumpulainen:  You can give the labels in call
%  h=boxplot(...'Labels',...)
%  h will be a matrix of handles to the line objects (not mentioned in documentation)
%  The line objects also have tags that can be used to find their handles. 
%  But the Labels have no tag. You can find their handles among the children 
%  of the hggroup object, which is the only child of the axis:
%  hcc = get(get(gca,'Children'),'Children');
%  Usually the labels are the first ones (in reverse order from right to left).
%  The only ones of type text anyway: hl = findobj(hcc,'type','text')
%  Now you can set their properties.

 
 set(h1,'FontSize', 15); 
 % print -depsc 'fisheriris2.eps'
 
% %-----------------
% % stsa = meas(1:50, : );  %setosa
% % mean(stsa)
% % mean(stsa(:)) 
% % mean(mean(stsa))
% % var(stsa)

%%
% this part produces Figure 'fisherlengths.eps'
close all
clear all

load fisheriris
X = meas(:, 1);    % sepal length
Y = meas(:, 3);    % petal length
[n,a,b]= hist2d(X, Y);
figure(1)
imagesc(a(1,:),b(:,1),n);
hold on
plot(X, Y,'ko','MarkerSize',7, 'LineWidth',1, 'MarkerFaceColor','w')
set(gca, 'Ydir', 'normal');
xlabel('Sepal Length');
ylabel('Petal Length');
colorbar
%print -depsc 'C:\Springer\Descriptive\Descriptiveeps\fisherlengths.eps'

figure(2)
hand = scattercloud(X,Y,50,1,'wx','jet')
set(hand, 'MarkerSize', 8, 'LineWidth',2);
xlabel('Sepal Length');
ylabel('Petal Length');
%print -depsc 'C:\Springer\Descriptive\Descriptiveeps\fisherlengthsc.eps'

figure(3)
smoothhist2D([X Y], 10, [100, 100],[],'surf')
set(gca, 'Ydir', 'normal');
%colorbar
view(45,30);
% label the axes
xlabel('Sepal Length');
ylabel('Petal Length');
zlabel('');
%print -depsc 'C:\Springer\Descriptive\Descriptiveeps\fisherlengthss.eps'


