How do we edit xticks datetime format?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I am trying to increase the number of date tick marks on a graph,
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/162236/image.jpeg)
but I cannot change the resulting datetime format:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/162237/image.jpeg)
Code that I think ought to work to obtain this result doesn't. I have tried the following (with a different initial datetime):
xticks(linspace(datetime('1234-11-06'),datetime('2067-04-25'),6))
xticks(linspace(datetime('06-Nov-1234','Format','yyyy-MM-dd'),datetime('25-Apr-2067','Format','yyyy-MM-dd'),5))
xticks(linspace(datetime('1234','InputFormat','y','Format','y'),datetime('2067','InputFormat','y','Format','y'),8))
xticks(linspace(datetime('1234','InputFormat','y','Format','yyyy-MM-dd'),datetime('2067','InputFormat','y','Format','yyyy-MM-dd'),8))
What is the problem? How do I increase the number of dates?
1 Kommentar
Steven Lord
am 28 Mär. 2017
Which release are you using?
How did you create the plot? Did you plot with numeric or datetime X data? It can make a difference.
Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!