Problems with positioning of data labels in a stacked bar chart created by Matlab App

2 ビュー (過去 30 日間)
John Hoop
John Hoop 2020 年 6 月 15 日
回答済み: Ajay Pattassery 2020 年 7 月 23 日
I created a Matlab app to draw bar chart. The plot works fine. But, I am experiencing 2 problems:
1) It seems that I can not freely put the data labels where I want in the graph
2) I do not know how to te show/create the legend
Could anyone please advise me?

回答 (1 件)

Ajay Pattassery
Ajay Pattassery 2020 年 7 月 23 日
  1. You can use xticklabels to add labels to the bar plot at points defined in xticks.
bar([2 3 4])
xticklabels({'first','second','third'})
2. Similarly the legend function can be used to add descriptive label for the plotted series.
legend('data')

カテゴリ

Help Center および File ExchangeBar Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by