필터 지우기
필터 지우기

how to add a subscript in colour map labels

조회 수: 2 (최근 30일)
MS
MS 2020년 5월 8일
편집: Cris LaPierre 2020년 5월 8일
How to add a subscript to a text(Uo) in matlab 2020a. Please help me to write a subscript to colour map label.
h.Label.String = 'ωc/U_{0}';% not the right way
  댓글 수: 2
Ameer Hamza
Ameer Hamza 2020년 5월 8일
This code seems to work fine. I am usin R2020a. Can you show what is the output on your system?
MS
MS 2020년 5월 8일
you are correct ameer. It only works without LaTex interpreter. Kindly let me know if you know the solution to work with LaTex interpreter.

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

채택된 답변

Cris LaPierre
Cris LaPierre 2020년 5월 8일
편집: Cris LaPierre 2020년 5월 8일
The interpreter in app designer only works for figure objects (title, labels, text, legend). See this post for possible workarounds for other components.
  댓글 수: 3
Cris LaPierre
Cris LaPierre 2020년 5월 8일
편집: Cris LaPierre 2020년 5월 8일
I think the issue here is you have a greek symbol already in your string (omega). This appears to be messing up the interpreter. You have two options. To subscript in a colorbar label, you don't need to specify an interpreter. Try doing just this:
h.Label.String = 'ωcU_{0}';
If instead you want to use the latex interpreter, you have to provide valid LaTeX code enclosed in "$":
h.Label.Interpreter = 'latex';
h.Label.String = '$\omega c/U_{0}$';
MS
MS 2020년 5월 8일
Thanks, it worked for me.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Labels and Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by