필터 지우기
필터 지우기

Plotting double vs datetime (DD-MM-YY), only the year is used from the datetime

조회 수: 8 (최근 30일)
I am trying to plot datetime data (y axis) against double precision (x axis), but only the year is extracted from the datetime data. The two data files are attached.
Based on the matlab doc and six similar inquiries on this question, this should work, but there's evidently something I'm missing.
  댓글 수: 3
Walter Roberson
Walter Roberson 2023년 11월 6일
Please be more specific about your plotting command. There are a fair number of different variables in the files.
Paul Barrette
Paul Barrette 2023년 11월 7일
Thanks and sorry - I should have provided more information. I'll spend some time understanding those files first.

댓글을 달려면 로그인하십시오.

채택된 답변

Peter Perkins
Peter Perkins 2023년 11월 10일
Paul, in addition to what Walter said, those mat files each contain a bunch of 23041xN variables. Likely you would benefit from storing all those in one timetable.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2023년 11월 6일
Speculating about what you are plotting:
If you
plot(SNOW_GP,DATE)
then your y axis has about 40 years. In order for it to be meaningful to display month as part of the output, you would need to have at least 80 yticks -- unless, that is, you wanted to do something like mark every 2 1/2 years.
You can use code such as
ax = gcal
ax.YRuler.TickLabelFormat = 'uuuu-mm';
but unless you yticks to include some mid-year dates, it is not going to be useful to do so.
  댓글 수: 1
Paul Barrette
Paul Barrette 2023년 11월 7일
Thank you for this, Walter. That does clarify the issue. I will spend more time on this.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by