Effacer les filtres
Effacer les filtres

Different colors for different text in a single textbox

100 vues (au cours des 30 derniers jours)
Mark Stone
Mark Stone le 24 Déc 2022
Commenté : Voss le 24 Déc 2022
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.

Réponse acceptée

Voss
Voss le 24 Déc 2022
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 commentaires
Mark Stone
Mark Stone le 24 Déc 2022
Great. Thanks.
Voss
Voss le 24 Déc 2022
You're welcome!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Tags

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by