How to change several text parts in legend to be bold and colored and unchange others?
80 ビュー (過去 30 日間)
古いコメントを表示
Hi
I need to highlight some pats of my legend, I wanted to set color and bold type to some text parts of my legend, but what I have found dont work in Matlab 2019, for example Bold symbol in Matlab legend or How do I change just one text in a legend without also changing the properties of the other text in the legened in MATLAB 7.8 (R2009a)?
Simple \bf with differents types of Interpreter does not work as well.
So is there a way to do it? Could you please help me
Thanks, looking forward to yours reply
0 件のコメント
採用された回答
Neuropragmatist
2019 年 8 月 14 日
What is wrong specifically with using the tex interpreter?:
figure
plot(rand(10,1),rand(10,1),'ko',rand(10,1),rand(10,1),'ro',rand(10,1),rand(10,1),'bo','MarkerSize',10);
hold on
daspect([1 1 1])
ax = gca;
l = legend('\color{black}\bf legend entry 1','\color{red} legend entry 2','\color{red} legend {\bfentry\rm} \color{blue}foo','Location','EastOutside');
legend boxoff
Here I have a legend entry with bold black text, red normal text and red text with only one word in bold that then changes to blue at the end.
That seems to cover every combination you could possibly want.
Hope this helps,
M.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Legend についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!