how to add a subscript in colour map labels
3 次查看(过去 30 天)
显示 更早的评论
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
2020-5-8
This code seems to work fine. I am usin R2020a. Can you show what is the output on your system?
采纳的回答
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
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}$';
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!