How can I change the text color within a multi-line cell array
Show older comments
I'm adding multi-line text to a plot using a cell array and the text command. I can change font attributes like bold and italics but I need to change the color of one line.
label(4) in the code below needs to be bold (no problem there) but I'd like it to be red as well. Putting attributes in the cell like this ... ['\bfTarget Length Met','color','r'] gives me an error.
label(1)={['S = ',num2str(compliance,formatSpec),' mm/kN']};
label(2)={['R^2 = ',num2str(rsq)]};
label(3)={['a = ',num2str(acur)]};
label(4)={['\bfTarget Length Met']};
text_xplace=min(cmod)+(max(cmod)-min(cmod))/10;
text_yplace=f_max-(f_max-min(force))/4;
text(text_xplace, text_yplace,(label))
Any one got a solution?
Accepted Answer
More Answers (0)
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!