How to avoid overlap of tick mark label strings generated by dynamicDateTicks.m?
3 views (last 30 days)
Show older comments
Is there a way to avoid overlapping tick mark label strings generated by dynamicDateTicks.m?
As an example, afigure consuming 1/2 of the screen, has roughly 11 tick marks. Use of the function dynamicDateTicks.m has resulted in values of the form HH:MM largely, however, the series does span multiple days - some of the tick mark labels are formatted in mm/dd HH:MM. These are long, and run into the other labels.
Possible solutions are of course adjusting aspect ratio or reducing the number of tickmarks.
It would be great to know if dynamicDateTicks.m had a mechanism to handle this.
0 Comments
Answers (1)
Seth Furman
on 15 Oct 2020
Edited: Seth Furman
on 15 Oct 2020
Consider using datetime arrays for your data when plotting. The default behavior includes tick labels that automatically update similar to the dynamicDateTicks.m File Exchange submission.
See the following documentation page for information on converting datenum arrays to datetime arrays.
Alternatively, consider rotating your axis labels to avoid overlapping.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!