Creating a Legend for a Boxplot with Two Colors
Mostrar comentarios más antiguos
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.
Respuesta aceptada
Más respuestas (1)
Oleg Komarov
el 28 de Jun. de 2011
1 voto
Use the option labels, dunno if it is a bug but legend doesn't seem to work.
Categorías
Más información sobre Legend en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!