フィルターのクリア

How to rotate xaxis labels (bar graph)

11 ビュー (過去 30 日間)
Colby
Colby 2015 年 3 月 10 日
回答済み: Rae.K 2022 年 11 月 7 日
I'm having a very difficult time figuring out how to rotate the x-axis labels on a bar graph. If I have the code at the bottom, I get the error Undefined function or variable 'rotateXLabels'.
Error in Test1 (line 5) rotateXLabels(gca, 45);
numbers = magic(5) labels = {'label 1', 'label 2', 'label 3', 'label 4', 'label 5'}; bar(numbers(:,1)) set(gca, 'XTickLabel', labels) rotateXLabels(gca, 45);
Does anyone know how to rotate the axis labels? Thanks
  1 件のコメント
Colby
Colby 2015 年 3 月 10 日
Code got jumbled in the copy-paste. sorry
numbers = magic(5)
labels = {'label 1', 'label 2', 'label 3', 'label 4', 'label 5'};
bar(numbers(:,1))
set(gca, 'XTickLabel', labels)
rotateXLabels(gca, 45);

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

採用された回答

Giorgos Papakonstantinou
Giorgos Papakonstantinou 2015 年 3 月 10 日
  2 件のコメント
Colby
Colby 2015 年 3 月 10 日
Great, thanks.
Miquel
Miquel 2017 年 9 月 12 日
The question you are linking to is not available anymore: "We might have deleted it because your question did not receive an answer or any other activity in 14 days. We also delete questions if they contain spam, are off topic, are no longer valid for any of our products, or violate the MATLAB Central Terms of Service." Please, answer it :)

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

その他の回答 (1 件)

Rae.K
Rae.K 2022 年 11 月 7 日

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by