필터 지우기
필터 지우기

How to display latex expression with natural log in a plot's legend?

조회 수: 6 (최근 30일)
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

채택된 답변

Star Strider
Star Strider 2019년 7월 6일
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
Minh Tran
Minh Tran 2019년 7월 6일
Beautiful, thanks. Any particular reason why this is?
Capture3.jpg
Star Strider
Star Strider 2019년 7월 6일
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.)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Legend에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by