how do I match the datetick?

1 回表示 (過去 30 日間)
Lilya
Lilya 2017 年 12 月 5 日
コメント済み: Lilya 2017 年 12 月 5 日
Hi all,
I've attached the plot that I want to correct the datetick (it doesn't match with the real date). Could anyone help, please?
thanks in advance.
  2 件のコメント
Walter Roberson
Walter Roberson 2017 年 12 月 5 日
The x axes ranges from 0 to 800. What should the corresponding date and times be for 0 and 800, and which dates/times do you want marked on the axis?
Lilya
Lilya 2017 年 12 月 5 日
編集済み: Lilya 2017 年 12 月 5 日
it should be hours 744hr/1 month (Aug or july =31 days)

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2017 年 12 月 5 日
h = openfig('AugWnd.fig');
ax = get(h,'CurrentAxes');
ax.XAxis.TickLabels = cellstr(datestr(ax.XAxis.TickValues/24 + datenum('2017-08-01'),'dd-mmm'));
Note that the ticks are 100 hours apart. You might want to consider changing ax.XAxis.TickValues to [0:96:799, 800] to get every 4 days plus the end point.
  1 件のコメント
Lilya
Lilya 2017 年 12 月 5 日
Awesome! thank you so much

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTitle についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by