
any way to add legend in bar plot like this?
1 ビュー (過去 30 日間)
表示 古いコメント
Hi:
is there anyway to add legend of a bar plot like below? i.e. put the bar plot on the left side and the legend on the right side, in one figure.

Thanks!
Yu
0 件のコメント
回答 (1 件)
KALYAN ACHARJYA
2019 年 6 月 4 日
編集済み: KALYAN ACHARJYA
2019 年 6 月 4 日
See this example
y=[2 2 3; 2 5 6; 2 8 9; 2 11 12];
bar(y,'stacked');
legend('level1','level2','level3','Location','Best','FontSize',8);

2 件のコメント
KALYAN ACHARJYA
2019 年 6 月 4 日
編集済み: KALYAN ACHARJYA
2019 年 6 月 4 日
You can drag (cursor move) and place in figure window. My Matlab v 2018b

参考
カテゴリ
Find more on Legend in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!