% File: http://web.mit.edu/8.13/matlab/Examples/subplots.m % Author: Scott Sewell % Date: 2008-June-11 % Demonstrates the utility of the Matlab 'subplot' command to display % a raw data set for which a graphical representation is useful. % This is particulary useful for inclusion of an experiments raw data % into the appendix of a written summary. % Requires 'gauss3.dat' clear; load gauss3.dat; x = gauss3(:,1); y = gauss3(:,2); figure('Name','Figure Example Using subplot to display related data'); clf; subplot(3,3,1); plot(x,y); xlabel('\theta = 10'); grid on; subplot(3,3,2); plot(x+10,y+10); title('Use the subplot command to display related data','fontsize',14); xlabel('\theta = 15'); grid on; subplot(3,3,3); plot(x+20,y+20); xlabel('\theta = 30'); grid on; subplot(3,3,4); plot(x+30,y+25); xlabel('\theta = 40'); grid on; subplot(3,3,5); plot(x+40,y+30); xlabel('\theta = 50'); grid on; subplot(3,3,6); xlabel('\theta = 60'); plot(x+50,y+35); grid on; subplot(3,3,7); plot(x+60,y+40); xlabel('\theta = 70'); grid on; subplot(3,3,8); plot(x+70,y+45); xlabel('\theta = 80'); grid on; subplot(3,3,9); plot(x+80,y+50); xlabel('\theta = 90'); grid on;