How do I add labels next to the 3 180 xticks? Like sampleA for the first one, sampleB for the second, etc. Thanks!
>> xt = xticks
xt =
Columns 1 through 5
0 180 360 450 630
Columns 6 through 9
810 900 1080 1260
>> xtl=xticklabels
xtl =
9×1 cell array
{'0' }
{'180'}
{'360'}
{'0' }
{'180'}
{'360'}
{'0' }
{'180'}
{'360'}

1 件のコメント

madhan ravi
madhan ravi 2020 年 9 月 30 日
xticklabels('SampleA, ...) %?

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

 採用された回答

Adam Danz
Adam Danz 2020 年 9 月 30 日
編集済み: Adam Danz 2020 年 10 月 1 日

0 投票

Set the XTickLabel propery of the axis. Use newline to break apart a string into multiple lines.
Quick demo:
ax = cla();
ax.XLim = [0,4];
ax.XTick = 1:3;
ax.XTickLabel{2} = '180\newline A';
"\newline" inserts a line break within the label.

1 件のコメント

Yi-xiao Liu
Yi-xiao Liu 2020 年 10 月 2 日
Yep this works. Thanks!

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

その他の回答 (0 件)

カテゴリ

製品

リリース

R2019b

タグ

質問済み:

2020 年 9 月 30 日

コメント済み:

2020 年 10 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by