フィルターのクリア

How can I add the values to the top of the bars?

2 ビュー (過去 30 日間)
Volkan Yangin
Volkan Yangin 2017 年 4 月 2 日
コメント済み: Star Strider 2017 年 4 月 2 日
Hi everbody
To add the values of bars (like as the image), what kind of a code can be written?
Thanks...
graf=[10 15]
bar(graf,0.2,'m')
set(gca,'XTickLabel',{'X','Y'})
ylabel( '% ')
grid on

採用された回答

Star Strider
Star Strider 2017 年 4 月 2 日
Try this:
graf=[10 15]
bar(graf,0.2,'m')
set(gca,'XTickLabel',{'X','Y'})
ylabel( '% ')
xt = get(gca, 'XTick'); % Values For ‘X-Ticks’
text(xt, graf, {'10%','15%'}, 'VerticalAlignment','bottom', 'HorizontalAlignment','center')
set(gca, 'YLim',[0 20])
grid on
  2 件のコメント
Volkan Yangin
Volkan Yangin 2017 年 4 月 2 日
Thank you, Star Strider.
Star Strider
Star Strider 2017 年 4 月 2 日
My pleasure.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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