MATLAB Answers

how to name xbars with the names on number sequence?

2 ビュー (過去 30 日間)
Philippe Corner
Philippe Corner 2018 年 1 月 26 日
コメント済み: Philippe Corner 2018 年 2 月 18 日
If I have 10 bars on a bar graph, how could i name each bar with a sequence number, for example to use
names=[1:1:10]
set(gca,'xticklabel',names)

採用された回答

Star Strider
Star Strider 2018 年 1 月 26 日
That looks as though it should work. If it is not working, add 'XTick' to specify the locations where the labels should appear:
names = [1:1:10];
set(gca, 'XTick',names, 'xticklabel',names)
  3 件のコメント
Philippe Corner
Philippe Corner 2018 年 2 月 18 日
Mr star Strider, could you check this question out please? https://la.mathworks.com/matlabcentral/answers/383371-how-to-make-all-the-legend-appear-in-a-plot

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

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by