Stacked bar plot, assign "names" to color

2 次查看(过去 30 天)
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".

回答(1 个)

Scott MacKenzie
Scott MacKenzie 2021-6-10
编辑:Scott MacKenzie 2021-6-10
Just add labels to your legend:
labels = { 'Jack', 'Fred', 'abc', 'def' }; % fill out, as desired
legend(labels);

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by