Stacked bar plot, assign "names" to color

2 visualizaciones (últimos 30 días)
Yuhan Wang
Yuhan Wang el 10 de Jun. de 2021
Editada: Scott MacKenzie el 10 de Jun. de 2021
How can I assign names to color? In the figure, say, in the right side list, I will assign "Jack's Contribution" to blue instead of "data 6".

Respuestas (1)

Scott MacKenzie
Scott MacKenzie el 10 de Jun. de 2021
Editada: Scott MacKenzie el 10 de Jun. de 2021
Just add labels to your legend:
labels = { 'Jack', 'Fred', 'abc', 'def' }; % fill out, as desired
legend(labels);

Categorías

Más información sobre Annotations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by