How to implement subscript and superscript in legend (Matlab)

399 Views Asked by At

I am wondering how to implement text in a legend with both a superscript and a subscript, and with an horizontal bar, something like this: Image

1

There are 1 best solutions below

0
On BEST ANSWER

Whenever you want to use some $\LaTeX$-style text in MATLAB, you have to specifiy the corresponding Interpreter option to use LaTeX. For a legend with your provided example this works with

legend("$\bar{H}^{front}_{debris}$",'Interpreter','latex')