%% ================================================================
% John Kerl
% kerl at math dot arizona dot edu
% 2007-01-27
%% ================================================================

% To load into Matlab:  just type the name of this file, without the .m
% extension.

clf;

%% ----------------------------------------------------------------
% Here is the graphing window.  Edit to taste.
xmin= 0;
xmax= 1;
ymin=-1;
ymax= 1;

%% ----------------------------------------------------------------
% For this example, I have a coarse plot and a fine plot.
% Often, we can just have a single n=512.
nfine = 512;
ncoarse = 8;

%% ----------------------------------------------------------------
% Make one plot component.
freq = 9;

x=[xmin:(xmax-xmin)/nfine:xmax];
y = sin(freq*2*pi*x);
plot(x,y);
hold on;

% Make another plot component.
freq = 1;

x=[xmin:(xmax-xmin)/nfine:xmax];
y = sin(freq*2*pi*x);
plot(x,y, ':');
hold on;

% Make a third plot component.
freq = 9;

x=[xmin:(xmax-xmin)/ncoarse:xmax];
y = sin(freq*2*pi*x);
plot(x,y, 'o');
hold on;

%% ----------------------------------------------------------------
% Set up axes, labels, etc.
axis([xmin xmax ymin ymax]);
h1=line([xmin xmax], [0 0]);
set(h1, 'LineStyle', '--');
h2=line([0 0], [ymin ymax]);
set(h2, 'LineStyle', '--');
ylabel('Y label goes here');
xlabel('X label: \theta');
title('Title goes here');

set(gca, 'XTick', [xmin:1:xmax])
set(gca, 'YTick', [ymin:1:ymax])

%% ----------------------------------------------------------------
% Write the EPS file.
set(gcf, 'PaperPositionMode', 'Manual');
% Here, the figure is 7 inches wide by 3 inches high.
% Edit this to taste.
set(gcf, 'PaperPosition', [0 0 7.0 3.0])
% Here, set the name of the .eps file which will be written.
print -depsc matlab_figure

