Different colors for different text in a single textbox

66 ビュー (過去 30 日間)
Mark Stone
Mark Stone 2022 年 12 月 24 日
コメント済み: Voss 2022 年 12 月 24 日
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.

採用された回答

Voss
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);
  2 件のコメント
Mark Stone
Mark Stone 2022 年 12 月 24 日
Great. Thanks.
Voss
Voss 2022 年 12 月 24 日
You're welcome!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeText Data Preparation についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by