% PublicationGraphics.m
% This is a template for generating publication quality graphics
% to be included in a manuscript typeset in LaTeX for publication.
% In LaTeX, include in the preamble the package
% \include(graphicx)
% Around the place where the graph should be placed,
% use the command:
% 
% \begin{figure}
% \centering
% \includegraphics[width=0.9\linewidth]{sample.pdf}
% \caption{Sample figure showing how an encapsulated
% PostScript graphic may be included. This example
% is for a single column figure.\label{fig:single}}
% \end{figure}
% 
% The graph is generated in Matlab from a program like this one.
% The resulting plot is exported in pdf format in a file called
% sample.pdf here.
% The actual printed version of the graph actually look much better than
% that the screen version because of the better resolution.
% There may be some differences between the two versions!

clear all;
hold off;
% create points for 2 courves to be plotted:
Xvec = 0:0.01:pi/2; Yvec1 = sin(Xvec); Yvec2 = cos(Xvec);

% plot curve as a blue solid line
plot(Xvec,Yvec1,'b-','linewidth',2); hold on;

% plot another curve as a black dashed line
plot(Xvec,Yvec2,'k--','linewidth',2); % plot another curve

% place a legend to identify the 2 curves
legend('sin','cos'); % click and drag legend to reposition it if needed

% Fabricate some exprimental data:
npts = 20;
Xpts = linspace(0,pi/2,npts);
Xpts = Xpts + 0.2*(rand(1,npts)-0.5);
Ypts = sin(Xpts+0.3*(rand(1,npts)-0.5));
% plot the data points as red open circles of markersize 8
plot(Xpts,Ypts,'ro','MarkerSize',8);

% The labels for the x and y axes are a bit smaller in the actual pdf file
% than what it looks within Matlab. Fontsize of 24pt is the best size.
% The pdf output will look great.

xlabel('\lambda_{13}^2 ','fontSize',20);
%xlabel('$\bar{s_{xm}}$','fontSize',24);
ylabel('\Gamma (m/s^2)','fontSize',20);
title('A Publication Quality Graph in MATLAB','fontSize',20);

axis([0 pi/2 0 1.2]); % specifies [ xmin xmax ymin ymax] of plot

% The tick mark labels should have a fontsize of 20:
set(gca,'fontSize',14); % gca means get current axes

% May sometimes want to control the placement of the tick marks
% as well as the labels for the tick marks:
set(gca,'XTick',[0:pi/10:pi/2]);
set(gca,'XTickLabel',['Jan';'Feb';'Mar';'Apr';'May';'Jun']);


