Thursday, July 17, 2014

Publication Quality Legends in Excel

I've already written about making publication quality figures in excel.  The legends still cause problem since you can't edit individual characters.

For instance, if I have a legend label z = 0, "z" needs to be italics since it's a variable.  I can only italic the entire entry "z=0".  This is incorrect since the "0" shouldn't be italic.

The quick and dirty answer is to insert a text box and set the correct legend entries there, then move it over the top of the original entries to cover them up.  EXCEPT, you can adjust the size of the legend causing the spacing between entries to also adjust, but you can't adjust the spacing in a text box.  For me, I run the risk of running out of real estate on the figure because I can't make the legend smaller than the text box.

I have mathtype (this may work in equation editor too) so what I've done is typeset the legend entries in mathtype and copy them to the excel figure one at a time.  Make sure you have the cut and copy preferences set to MathML or LaTeX or else they won't embed into the figure and therefore, won't copy to word as an excel object (exporting as image should work though).

If you have your figure set up like I do in my previous post and the cut and copy preferences set, then each mathtype equation will show up as a picture.  For equations without subscripts and superscripts, setting the picture height to 0.16 will make the text 9 point - which is what I use for figures and captions.  Equations with Subscripts and Superscripts or fractions may have to be adjusted differently.

Once I have all the labels inserted, I align and group them and set the background to white.

Other plotting software can handle individual characters in legends.  Excel should be able to as well.

No comments: