필터 지우기
필터 지우기

Plotting time series axis time labels

조회 수: 3 (최근 30일)
Larry McDermott
Larry McDermott 2017년 10월 2일
댓글: Larry McDermott 2017년 10월 2일
Hi All, I'm able to plot nice 3-d data using mesh or surf. I'm labeling the y axis as time per code block below. It looks great, the only problem is y time axis only displays the time at the mid point of the axis (so only one time displayed). How can I increase the density of the time labels so that I see for example 10 times labeled across the axis? Also, it would be great if this axis/labels auto scales (so if I zoom in and now by displayed full scale time is 10 minutes I'd still see 10 (or some number > 1) of labels for time. Thanks for any feedback!
figure('Name','Spectral Time Series Plot');
ax2=mesh(my3dx,XaxisTime,myd3y);
datetick('y','HH:MM:SS','keepticks','keeplimits');
xlabel('WaveNumber');
ylabel('Absorbance');
ylabel('Sample (time)');
zlabel('Absorbance');
axis tight;

채택된 답변

Chad Greene
Chad Greene 2017년 10월 2일
Unfortunately dateticks are not dynamic, meaning if you set the dateticks and then zoom, the ticks don't get updated. You can manually set which ticks you want labeled before calling datetick with 'keepticks', or you can use the dynamic datetick function, which you can get from File Exchange.
  댓글 수: 2
Larry McDermott
Larry McDermott 2017년 10월 2일
Thanks for the quick response, I'll try the File Exchange function!
Larry McDermott
Larry McDermott 2017년 10월 2일
Hi Chad, I tried it and it shows the axis in the "serial date numbers" which were generated from a date/time string using datenum. Looking through the m-file but figured I'd ask if I'm doing something wrong? Thanks for any feedback.
figure('Name','Spectral Time Series Plot'); ax2=mesh(my3dx,XaxisTime,myd3y); %datetick('y','HH:MM:SS'); dynamicDateTicks([], 'hh/mm/ss',[]); xlabel('WaveNumber'); ylabel('Absorbance'); ylabel('Sample (time)'); zlabel('Absorbance'); axis tight;

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by