How to change the tick frequency on a timeseries x axis

Hello can u please let me know how can I change the xticks on a time series. The ticks are displayed every 3 months, while I need one month ticks. The time series dates are real data and can not evenly distribute them. Thank you for your reply. Best, Nick

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 27 Jan. 2014
Bearbeitet: Walter Roberson am 27 Jan. 2014

0 Stimmen

You will need to set the axes XTick property yourself.

Weitere Antworten (1)

Nikolaos Zikas
Nikolaos Zikas am 27 Jan. 2014

0 Stimmen

Thank you for your timely response. Any idea of how that can be done?

3 Kommentare

If the X axis is in serial date number, then a month is approximately 30 days, so at first pass you could use
set(gca, 'XTick', (first_datenum : 30 : last_datenum) );
There are more exact methods, of course.
thank you. I appreciate your help.
can you tell exact method as well?

Melden Sie sich an, um zu kommentieren.

Kategorien

Community Treasure Hunt

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

Start Hunting!

Translated by