active date axis in plot: zoom in from year to hour
2 次查看(过去 30 天)
显示 更早的评论
Dear Matlab Community,
I have a time series plot includes data from Sept to May. I want to see the hourly plot when I zoom in but guess I am missing a point.
I have tried to use dynamicDateTicks as:
Option 1:
dynamicDateTicks([],[],'yy/mm/dd hh/mm/ss')
Option 2:
dynamicDateTicks()
and other variations as mm/dd, yy/mm/dd but nothing is changed.
Do you have any suggestion for dynamic plots?
Thank you in advance!
Best,
Ezgi Asirok
3 个评论
dpb
2022-6-24
编辑:dpb
2022-6-24
..."tried to use uppercase in date and time ..."
Could be interpreted a couple of ways -- but if used all uppercase, that's not right, either. The date portion is lower case, the time portion upper. The case difference is how it knows the difference between months and minutes, both of which use some number of the letter 'm' -- mixing cases for one in the location for the other is a problem. I've not checked just how good the error diagnostics are and don't recall datetick behavior well enough to know whether it would provide error/warning messages or just quietly give unexpected results -- or whether the wrapper code may have stuff inside try...catch constructs and hide errors that aren't handled.
That is quite old code; not terribly surprising it may not work with newer releases...would take a lot of digging to uncover where things may have gone south and with datetime there's really no reason to invest time into it -- datenum had its day in the sun, but has been eclipsed in current MATLAB implementations by the new datetime and duration classes -- and since TMW will not be updating plotting routines in particular to use a datenum with automated axes recognition, there really isn't reason to use them in new code.
There's a convenience with datenum for some purposes, granted, in that they can hold a time portion independent of a date that a datetime can't (one must use duration for that, instead).
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Time Series Objects 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!