problem using xticks and xticklabels

2 ビュー (過去 30 日間)
ANKUR KUMAR
ANKUR KUMAR 2017 年 12 月 12 日
編集済み: Jan 2017 年 12 月 12 日
Now, I have a plot whose x axis starts from 0 to 600 and tick labels are there in the interval of 100. Labels are there at the interval of 100 is fine but I want 10 xticks between 0 and 100 (only ticks). I have tried with xtick
xticks([1:10:600])
but everytime I have to define xtick labels also for every xticks.
Is there any way to add just xticks (not xticklables).

回答 (1 件)

Jan
Jan 2017 年 12 月 12 日
編集済み: Jan 2017 年 12 月 12 日
axes('XTick', 1:10:600, 'XTickLabelMode', 'manual', 'NextPlot', 'add');
plot(1:1000, rand(1, 1000));
I'm not sure if this works, because I cannot try it. Setting the 'TickLabels' manually as suggested by Birdman works also, because this sets the 'XTickLabelMode' to 'manual' also implicitly.

カテゴリ

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