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,'r-') legend('sin(x)/x') subplot(n,m,2) hold on title('Plot 2') load silver_mod.dat plot(silver_mod(:,2),silver_mod(:,3),'r+') legend('silver.dat') subplot(n,m,3) hold on title('Plot 3') load immigration_mod.dat; Y = [immigration_mod(:,4),immigration_mod(:,9), ... immigration_mod(:,10),immigration_mod(:,13)]'; hb = bar(Y,'stacked'); set(gca,'xtick',[1:4], 'xticklabel', ['Austria';'France '; ... 'Germany';'Italy '],'Ytick',[])y set(hb,'linestyle','none') end