How to display latex expression with natural log in a plot's legend?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Minh Tran
am 6 Jul. 2019
Kommentiert: Star Strider
am 6 Jul. 2019
I'm having trouble getting the following LaTex expression to display in the legend. I used those expresions in the Live Editor's Insert Latex Equation and they were accepted so I'm not sure why I'm getting the warning.
![LatexInLegend.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/227784/LatexInLegend.jpeg)
0 Kommentare
Akzeptierte Antwort
Star Strider
am 6 Jul. 2019
You have to begin and end each part of the expression with dollar-signs ($).
So:
'$e^\frac{ln(k)}{k}(t-k)$'
and so for the rest.
2 Kommentare
Star Strider
am 6 Jul. 2019
As always, my pleasure.
The ‘$’ are a LaTeX convention for specifying the maths expressions. See: The Not So Short Introduction to LaTeX2e for an extended discussion. (If I remember correctly, the section on maths begins about page 56.)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu LaTeX finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!