Stacked bar plot, assign "names" to color

3 ビュー (過去 30 日間)
Yuhan Wang
Yuhan Wang 2021 年 6 月 10 日
編集済み: Scott MacKenzie 2021 年 6 月 10 日
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 Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by