how to remove labels from legend in plot and keep only text
12 ビュー (過去 30 日間)
古いコメントを表示
Hi, there,
I'm using legend and I want to remove the colored labels and keep only the text in the legend (Matlab 2018b).
Is there any way to do that?
(I tried using annotation, I don't want the box to be there - just text)
0 件のコメント
採用された回答
Image Analyst
2019 年 2 月 1 日
Did you try just making up a cell array of strings that are spaces and passing that cell array to legend()? Should be rather straightforward.
ca = {' ', ' ', ' '};
legend(ca);
If you can't figure it out, let me know how many items there are in the legend.
2 件のコメント
Image Analyst
2019 年 2 月 1 日
Oh, sorry - that will get rid of the text and keep the colors. You want the opposite - keep the text and get rid of the colors. So for that you use the text() function. it gives you complete control.
その他の回答 (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!