Legend label - differential dot above letter with a subscript

I'm trying to have one of my legend labels be "X_Piston" where X has the differential dot above it and 'Piston' is in Subscript format. I can get the differential dot but cannot seem to get the subscript. Any help is appreciated, thank you!!
name = legend('$\dot{X}$');
set(name,'Interpreter','latex');

 Réponse acceptée

Hello,
How about this
name = legend('$\dot{X}_{Piston}$');
set(name,'Interpreter','latex');

6 commentaires

Adam Danz
Adam Danz le 29 Juil 2019
Modifié(e) : Adam Danz le 29 Juil 2019
ditto. I just removed my duplicate answer after seeting infinity's.
Yes,this worked!! Thank you!
Can I add another item to this legen that uses a subscript but not the differential dot?
Yes. You can do like this
name = legend('$\dot{X}_{Piston}$', '$X_{Piston}$');
set(name,'Interpreter','latex');
thank you!
You are welcome!

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by