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
Start with the simple figure;
h_plot = plot([0 1], [0 1]);
h_legend = legend('A',0);
The spacing I really want would be something like this with
h_plot = plot([0 1], [0 1]);
h_legend = legend('A!!!!!!!!',0);
where the !!!!!!!! is actually whitespace, and it really is stored as one character 'A'.
A few things which did not seem to work:
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 http://engineeringrevision.com/314/getting-illustrator-to-play-nicely-with-psfrag/ for example). So I really need to just have the 'A' character as the string.
Another is to try to stretch the box, but chanking the position or the aspect ratio streches the text and line accordingly.
For example, the following just stretches the width
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);
- The
legendflex
file looks very interesting, but I think the control over the whitespace buffering was only for the position of the legend itself.