Script for making publication quality figures

From Horace
Revision as of 15:44, 31 October 2014 by Russell Ewings (Talk | contribs) (Created page with "<pre> %Customising plots (mostly using Matlab tools to edit figures) proj.u=[1,1,0]; proj.v=[-1,1,0]; proj.uoffset=[0,0,0,0]; proj.type='rrr'; %===============================...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

%Customising plots (mostly using Matlab tools to edit figures)

proj.u=[1,1,0]; proj.v=[-1,1,0]; proj.uoffset=[0,0,0,0]; proj.type='rrr';

%=============================================
%Make slice to plot
my_slice=cut_sqw(sqw_file,proj,[-5,0.1,5],[-1,1],[-1,1],[0,10,900]);

plot(smooth(compact(d2d(my_slice))));%default smoothing applied, compact function makes the axes tight around the data

%Set the axes limits using lx, ly, lz commands


%Make a nicer title
title('QE slice');

%Label the axes with something nicer
xlabel('(h,h,0) (r.l.u.)');
ylabel('Energy (meV)');

%Get rid of the colour slider, but keep the colour bar (have to delete the slider, then replace with just the bar)
colorslider('delete');
colorbar

%Make the above labels with a different font size to the default
title('QE slice','FontSize',16);
xlabel('(h,h,0) (r.l.u.)','FontSize',16);
ylabel('Energy (meV)','FontSize',16);

%Use the Matlab graphics handle to set the font size of axes and associated properties
set(gca,'FontSize',16);

%Other properties (found by typing get(gca)) can be edited in a similar way


%Put some text on the figure (position in terms of the plot's units are the first two arguments)
text(-0.5,220,'Ei = 1200 meV','FontSize',16);

%Some fancier text to label the colour bar:
tt=text(6.9,550,'Intensity (mb sr^-^1 meV ^-^1 f.u.^-^1)','FontSize',16);
set(tt,'Rotation',-90);%Flip the text around so that it reads from top to bottom

%Save as jpg and eps (colour)
print('-djpeg ','/my_path/etc/fig_1a.jpg');
print('-depsc ','/my_path/etc/fig_1a.eps');