How to query the date format when using dynamicDateTicks.m?

4 vues (au cours des 30 derniers jours)
Chris L'Esperance
Chris L'Esperance le 12 Oct 2020
How can we query the date format when using dynamicDateTicks.m? The use case is dynamically displaying a corresponding date/time format in the axis label.

Réponses (1)

Seth Furman
Seth Furman le 15 Oct 2020
See my recommendation to use datetime data when plotting, related to your other question, here:
If you use datetime data, you can easily query the datetime format from the axes using the following functions
For example,
>> plot(datetime('today'):caldays:30*caldays+datetime('today'),1:31)
>> xfmt = xtickformat
xfmt =
'MMM dd'

Catégories

En savoir plus sur Dates and Time dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by