Code covered by the BSD License  

Highlights from
Publication-ready graphics using 'readyforprint' and helper utilities

  • pretty_boxplot(ah)script to tidy up box plots using the example of http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/
  • pretty_timeplot(fh)script to tidy up x-y plots using the example of http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/
  • pretty_xyplot(ah)script to tidy up x-y plots using the example of http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/
  • readyforprint(wh,fs,fgcin...function readyforprint([W H],fntsize,fgc,bgc,lwidth)
  • demo.mSIMPLE X-Y PLOT WITH BLACK-FILLED MARKERS
  • View all files
image thumbnail

Publication-ready graphics using 'readyforprint' and helper utilities

by

 

18 Jan 2010 (Updated )

Function to create publication-ready graphics

pretty_xyplot(ah)
% script to tidy up x-y plots using the example of http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/

function pretty_xyplot(ah)

if exist('ah','var')
    if isempty(ah)
        ah = gca;
    end
else
    ah = gca;
end

for i =1:numel(ah)
    
    %% TICKS
    % move ticks on to the outside of the axes
    set(findobj(ah(i),'TickDir','in'),'TickDir','out');
    
    %% OTHER BITS n'PIECES
    set(ah(i), ...
        'Box'         , 'off'     , ...
        'TickDir'     , 'out'     , ...
        'TickLength'  , [.02 .02] , ...
        'XMinorTick'  , 'on'      , ...
        'YMinorTick'  , 'on'      , ...
        'ZMinorTick'  , 'on'      , ...
        'YGrid'       , 'on'      , ...
        'XColor'      , [.3 .3 .3], ...
        'YColor'      , [.3 .3 .3], ...
        'ZColor'      , [.3 .3 .3], ...
        'LineWidth'   , 1         );
end

Contact us