Creating a Legend for a Boxplot with Two Colors
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (1)
Oleg Komarov
le 28 Juin 2011
1 vote
Use the option labels, dunno if it is a bug but legend doesn't seem to work.
Catégories
En savoir plus sur Legend dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!