Matlab Xtick problems labeling where no bar exists and repeating labels

2 ビュー (過去 30 日間)
Shawn
Shawn 2013 年 12 月 13 日
回答済み: dpb 2013 年 12 月 13 日
I generated a bar graph, and tried to label the X axis with corresponding labels, but it seems that it labels ticks where the data is not available. Also it repeats the list.
bar([A B C D]),0.7,'stack') set(gca,'XTickLabel',{'North','South','East','West','NA'})
Any suggestions?

回答 (1 件)

dpb
dpb 2013 年 12 月 13 日
Tick labels will correspond 1:1 with the associated ticks on the axis.
If there are more ticks that labels, they will be recycled to match.
Fix the number of ticks and their positions as desired first, then write the labels to match.

カテゴリ

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