In 2016b is there a way to get categories on the x-axis of a bar chart?

1 回表示 (過去 30 日間)
Daniel Gray
Daniel Gray 2017 年 6 月 28 日
回答済み: Mishaal Aleem 2017 年 6 月 28 日
I have seen how to do it on the 2017 release, but wondered if there was a way to get categories on the x-axis of a bar chart as opposed to just numbers on the 2016b release?

採用された回答

Mishaal Aleem
Mishaal Aleem 2017 年 6 月 28 日
In R2016b, you can use 'xticklabels'. Please see the xticklabels documentation for more details.
Here is a simple example applied to a bar chart.
x = [1,2,3,4,5];
y = [3,5,6,7,2];
bar(x,y);
labels = {'A', 'B', 'C', 'D', 'E'}; % Labels to use on x-axis
xticklabels(labels);

その他の回答 (0 件)

カテゴリ

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