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!