Set datetick to month, independent of year

3 ビュー (過去 30 日間)
KNL
KNL 2019 年 11 月 20 日
コメント済み: Kavya Vuriti 2020 年 2 月 17 日
I have a list of dates of different years (in "Dates"-column), which I want to plot as a histogram over one year. I have thus converted the dates to day of year ("doy" column) and plotted it, see figure below.
My short code is:
file_mat.doy=day(file_mat.Date,'dayofyear');
figure
histogram(file_mat.doy, 'BinWidth',5,'FaceColor',[0 .5 .5]);
I want the x-axis to show the months from Jan to Dec at equal intervals, instead of the day of year. How can I do that?
Thanks
slett.JPG
  1 件のコメント
Kavya Vuriti
Kavya Vuriti 2020 年 2 月 17 日
Hi,
Could you please tell what exact information are you trying to plot. Because the mat file provided does not contain data corresponding to all months in an year. Also, there are multiple data for same month in an year.

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

回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by