40m QIL Cryo_Lab CTN SUS_Lab TCS_Lab OMC_Lab CRIME_Lab FEA ENG_Labs OptContFac Mariner WBEEShop
  40m Log  Not logged in ELOG logo
Message ID: 4271     Entry time: Thu Feb 10 14:52:36 2011
Author: Aidan 
Type: HowTo 
Category: Computers 
Subject: Adding filenames in MATLAB plots 

The following code is incredibly useful when creating  MATLAB plots as it adds the filename of the script to the plot itself. I think it should be used for all MATLAB plots that go on the elog.

For example, I have no idea where the data/script is that was used to generate these plots.

 

orient landscape

xposn = 0.0;

yposn = -0.13; % you sometimes have to tweak this value depending on the page size and the number of subplots

text(xposn,yposn,[filename('fullpath'), '.m'], ...

     'Units', 'normalized', ...

     'Interpreter', 'none', ...

     'FontSize', 6)

print('-dpdf', [filename('fullpath'), '.pdf'])

ELOG V3.1.3-