Different colors for different text in a single textbox
98 次查看(过去 30 天)
显示 更早的评论
Is it possible to have different colors for different text in a single text box?
For example,
1st line of text is black
2nd line of text is blue
3rd line of text is red.
0 个评论
采纳的回答
Voss
2022-12-24
str = { ...
'\color{black}1st line of text', ...
'\color{blue}2nd line of text', ...
'\color{red}3rd line of text'};
t = text(0.5,0.5,str);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Text Data Preparation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!