# Not getting properly formatted legend labels [closed]

So I have this problem: I'm having to plot the Exponential Integral and another function, but when I come to write the legend to make it to appear in the plot, I don't get the function with the argument, but a reversed writing.

Explaining myself better, this is the code:

Plot[{ExpIntegralEi[x], -ExpIntegralEi[-x]}, {x, -2, 3},
PlotRange -> {-5, 7},
PlotStyle -> {{Darker[Green], Thickness[0.004]}, {Blue,
Thickness[0.004]}},
PlotLegends ->
Placed[SwatchLegend[{Darker[Green],
LegendMarkerSize -> {30, 10}], {0.6, 0.8}],
LabelStyle -> {FontSize -> 11}]


So I want the legend $\text{Ei}(x)$ and $\mathcal{E}_1(x)$.

But what I get is this: How can I obtain in the legends the writing $\mathcal{E}_1(x)$ and so on?

• Try "\!$$\*SubscriptBox[\(\[ScriptCapitalE]$$, $$1$$]\)(x)" in an input cell, then copy the out result into the TraditionalForm[] box. – Feyre Oct 21 '16 at 12:47
• I'm using strings in such cases; go with {"Ei(x)", "E1(x)"}. – corey979 Oct 21 '16 at 12:47
• For optimum quality use MaTeX github.com/szhorvat/MaTeX – grbl Oct 21 '16 at 12:49
• @Feyre Nothing changes... Still the same. The $x$ comes first -.- – Henry Oct 21 '16 at 12:53
• You need to use the ", it works, I tried it, it's basically the same as what @corey979 suggested, only with making sure it gives a script E. – Feyre Oct 21 '16 at 12:54

Enter the labels in normal Mathematica stardard form and let TraditionalForm do the formatting.

Plot[{ExpIntegralEi[x], -ExpIntegralEi[-x]}, {x, -2, 3},
PlotRange -> {-5, 7},
PlotStyle -> {{Darker[Green], Thickness[0.004]}, {Blue, Thickness[0.004]}},
PlotLegends ->
Placed[
SwatchLegend[
{Darker[Green], Blue}, 