![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/611115/image.jpeg)
specifying only few tick labels
42 ビュー (過去 30 日間)
古いコメントを表示
I have 200 points of non numerical data type(ex:2:2|2:3, 2:3|2:4, 2:4|2:5 - - - - - 2:199|2:200) these are the x axis ticks. Out of all this i want to represent few ticks because on x axis the points will overlap as i was trying this in excel. Kinldy help me
0 件のコメント
回答 (1 件)
Scott MacKenzie
2021 年 5 月 7 日
編集済み: Scott MacKenzie
2021 年 5 月 7 日
Frist, decide on how many ticks labels you want, Then, create a cell array with the labels. Set the axis ticks and tick labels accordingly. The script below shows the general idea. There are 200 data points and 9 tick labels, equally spaced.
y = rand(1,200);
plot(y);
ax = gca;
ax.XTick = 0:25:200;
labels = { 'a', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
ax.XTickLabels = labels;
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/611115/image.jpeg)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Axis Labels についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!