title: Add extra whitespace to matlab legend (for use with psfrag)
body: <p>How to pad white-space on a matlab legend to the right of the text?  I am using a combination of psfrag (and adobe illustrator for a few other diagram modifications), and will replace the placeholder text in a figure with an equation.  The problem is that it tightly bounds the box on the placeholder text, while I want to leave room for my equation</p>
  
  <p>Start with the simple figure;</p>
  
  <pre><code>h_plot = plot([0 1], [0 1]); 
  h_legend = legend('A',0);
  </code></pre>
  
  <p>The spacing I really want would be something like this with</p>
  
  <pre><code>h_plot = plot([0 1], [0 1]); 
  h_legend = legend('A!!!!!!!!',0);
  </code></pre>
  
  <p>where the !!!!!!!! is actually whitespace, and it really is stored as one character 'A'.</p>
  
  <p>A few things which did not seem to work:</p>
  
  <ol>
  <li><p>One obvious solution is: just add in text such as "A!!!!!!!!!!!!" and replace the whole text with my equation in psfrag.  However, if I touch the file with Adobe Illustrator, then it converts the text to individual characters, which breaks psfrag (see <a href="http://engineeringrevision.com/314/getting-illustrator-to-play-nicely-with-psfrag/" rel="noreferrer">http://engineeringrevision.com/314/getting-illustrator-to-play-nicely-with-psfrag/</a> for example).  So I really need to just have the 'A' character as the string.</p></li>
  <li><p>Another is to try to stretch the box, but chanking the position or the aspect ratio streches the text and line accordingly.</p></li>
  </ol>
  
  <p>For example, the following just stretches the width</p>
  
  <pre><code>h_plot = plot([0 1], [0 1]); 
  h_legend = legend('A',0);
  leg_pos = get(h_legend,'position'); leg_pos(3) = leg_pos(3) * 2;
  set(h_legend, 'position', leg_pos);
  </code></pre>
  
  <ol>
  <li>The <code>legendflex</code> file looks very interesting, but I think the control over the whitespace buffering was only for the position of the legend itself.</li>
  </ol>