Filter löschen
Filter löschen

How can I increase x-axis ticks by 5 while the limit is auto?

1 Ansicht (letzte 30 Tage)
Mohammed Alhamdan
Mohammed Alhamdan am 28 Dez. 2022
Beantwortet: dpb am 28 Dez. 2022
How can I increase x-axis ticks by 5 while the limit is auto?
xticks(0:5:100)
this for example will increase it by 5 but I have to specify the limit

Akzeptierte Antwort

dpb
dpb am 28 Dez. 2022
Don't remember otomh whether it will affect the auto-range setting or not, but to solve the above issue about range, use something like
xlm=xlim; % retrieve current x limits
xticks(0:5:xlm(end)) % set by 5 over that range
You can be more clever about lower limit and rounding, etc., etc., depending on need and characteristics of the actual data.

Weitere Antworten (0)

Kategorien

Mehr zu Animation finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by