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

5 visualizaciones (últimos 30 días)
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.

Respuestas (1)

Seth Furman
Seth Furman el 15 de Oct. de 2020
Editada: Seth Furman el 15 de Oct. de 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.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by