How to implement subscript and superscript in legend (Matlab)

$\begingroup$

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

$\endgroup$ 1

1 Answer

$\begingroup$

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')
$\endgroup$

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like