Creating a Legend for a Boxplot with Two Colors
古いコメントを表示
Hi, I need help inserting a legend for a boxplot with two colors (red & blue). My code for this is:
boxplot(data, 'notch', 'on', 'symbol', '*','colors','rb');
legend('Label1','Label2');
But I get no legend and it says "Warning: Plot empty" in the command window. Any help on this matter would be much appreciated. Thank you.
採用された回答
その他の回答 (1 件)
Oleg Komarov
2011 年 6 月 28 日
1 投票
Use the option labels, dunno if it is a bug but legend doesn't seem to work.
カテゴリ
ヘルプ センター および File Exchange で Legend についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!