How to repeat a pattern on xticks?
古いコメントを表示
Hi all,
I have the following for a plot. How can I make the A,B,C,D,E repeat for 100 times on the x label with the same patttern A,B,...
set(gca,'XTickLabel',{'A','B','C','D','E'})
Also, is there anyway to make it appear 90° rotated on the x axis?
採用された回答
その他の回答 (1 件)
Mathieu NOE
2021 年 3 月 12 日
hello
this is an example for 20 repetition of the 5 letters pattern + 90° rotated
plot(1:100,randn(1,100));
set(gca,'XTick',(1:100),'XTickLabel',repmat({'A','B','C','D','E'},1, 20))
xtickangle(90)
2 件のコメント
Wolfgang McCormack
2021 年 3 月 12 日
編集済み: Wolfgang McCormack
2021 年 3 月 12 日
Mathieu NOE
2021 年 3 月 12 日
that's life ! it's hard to beat a MVP !! I have to admit I still have to learn a few things before I'm up to the task
カテゴリ
ヘルプ センター および File Exchange で Axes Appearance についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!