Add Legend Automatically Based on Tag Property Value

Add legend to axes based on values from plot handles Tag property
96 descargas
Actualizado 30 jul 2016

Ver licencia

Instead of adding a legend manually and making sure the colors are consistent, use the 'Tag' property for each plot to separate them. Then use the function add_legend to add a legend. The function groups all plots based on their Tag property, and give each group a separate color. It uses the Tag property values as labels in the legend.
I have included the function varycolor by Daniel Helmick:

https://www.mathworks.com/matlabcentral/fileexchange/21050-varycolor

Citar como

Hannes Mogensen (2024). Add Legend Automatically Based on Tag Property Value (https://www.mathworks.com/matlabcentral/fileexchange/58456-add-legend-automatically-based-on-tag-property-value), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2016a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Legend en Help Center y MATLAB Answers.
Etiquetas Añadir etiquetas
Agradecimientos

Inspirado por: varycolor

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versión Publicado Notas de la versión
1.0.0.0

Added credit to Daniel Helmick

Updated description