function threeplots(layout)
% function threepltos(layout)
% layout = 'v' results in the 3 plots arranged top to bottom
%        = 'h' results in the 3 plots arranged side by side
if layout == 'v'
  n = 3; m = 1;
else
  n = 1; m = 3;
end
uicontrol('Style', 'text', 'String', 'Multiplot layout 3, 1', ...
'HorizontalAlignment', 'center', 'Units', 'normalized', ...
'Position', [0 .95 1 .05], 'BackgroundColor', [.8 .8 .8]);
subplot(n,m,1)
hold on
title('Plot 1')
x = [-10:0.099:-0.1,0.1:0.099:10];
plot(x,sin(x)./x)
legend('sin(x)/x')
subplot(n,m,2)
hold on
title('Plot 2')
load silver.dat
plot(silver(:,2),silver(:,3),'r+')
legend('silver.dat')
subplot(n,m,3)
hold on
title('Plot 3')
load immigration.dat;
Y = [immigration(:,4),immigration(:,9),immigration(:,10),immigration(:,13)]';
bar(Y,'stacked');
set(gca,'xtick',[1:4], 'xticklabel', ['Austria'; 'France ';'Germany';'Italy  '],'Ytick',[])
end
