% File: http://web.mit.edu/8.13/matlab/Examples/axisproperties.m % Author: Scott Sewell % Date: 2008-June-11 % Demonstrates some of the myriad options for controlling the look and feel % of a graph's axis properties. % Requires 'gauss3.dat' clear; load gauss3.dat; x = gauss3(:,1); y = gauss3(:,2); figure('Name','Demonstrating manipulation of various axis properties'); clf; subplot(3,3,1); plot(x,y); hold on; ym=mean(y); plot([0 400],[ym ym],'Color','red') xlabel('Default plot(x,y)'); subplot(3,3,2); plot(x,y); xlabel('axis tight'); axis tight; title('Using axis properties to achieve various looks','fontsize',14); subplot(3,3,3); plot(x,y); xlabel('axis[50 150 -20 100]'); axis([50 150 -20 100]); subplot(3,3,4); semilogx(x,y); xlabel('semilogx(x,y)'); subplot(3,3,5); semilogy(x,y); xlabel('semilogy(x,y)')' subplot(3,3,6); loglog(x,y); xlabel('loglog(x,y)'); subplot(3,3,7); plot(x,y); grid on; xlabel('grid on'); subplot(3,3,8); plot(x,y); grid minor; xlabel('grid minor;'); subplot(3,3,9); plot(x,y); xlabel('\theta = 90'); axis off; text(20,20,'axis off');