Change portion of text color in matlab label
72 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Nathaniel H Werner
el 28 de En. de 2020
Respondida: Walter Roberson
el 29 de En. de 2020
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 comentarios
Respuesta aceptada
Walter Roberson
el 29 de En. de 2020
xlabel('black, \color{red}red', 'interpreter', 'tex')
0 comentarios
Más respuestas (1)
Image Analyst
el 29 de En. de 2020
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 comentarios
Ver también
Categorías
Más información sobre Labels and Annotations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!