How to avoid overlap of tick mark label strings generated by dynamicDateTicks.m?

3 次查看(过去 30 天)
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.

回答(1 个)

Seth Furman
Seth Furman 2020-10-15
编辑:Seth Furman 2020-10-15
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.

类别

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