Change portion of text color in matlab label
71 次查看(过去 30 天)
显示 更早的评论
I know that it is possible to change the color of a label in a figure in matlab from the default black to another color. I have a need to change only part of the label text to a different color. For example.
h = xlabel('black, red');
set(h, 'Color',[1, 0 ,0])
This should change the entire text to red instead of black, but I'd only like to change the color of the word red.
0 个评论
采纳的回答
更多回答(1 个)
Image Analyst
2020-1-29
Might have to look up Latex commands and embed Latex commands in the string. I don't know the Latex commands off the top of my head.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Labels and Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!