How can I keep the date visible at the bottom of the graph?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Needless Needless Also
le 26 Oct 2018
Commenté : Needless Needless Also
le 26 Oct 2018
So, I have been trying to figure out why the date at the bottom right of the graph keeps disappearing when I try to edit the X ticks and their labels. With the standard plot, the date is visible as shown:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/192667/image.png)
But it disappears when I edit the ticks:
set(gca,'XTickLabel',xt) %xt is a cell array with the labels (empty cell for removing label)
set(gca,'XTick', xticks) %xticks is a double vector with the tick positions
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/192669/image.png)
It is really helpful to be kept there and I can't find out. Any ideas? Thanks
0 commentaires
Réponse acceptée
jonas
le 26 Oct 2018
Modifié(e) : jonas
le 26 Oct 2018
xticks should not be a double vector if you use datetime, it should be a datetime vector. I would expect anything else to return an error, but I could be wrong. Also, why are you changing the labels? Doing so will likely cause this behaviour. The date at the bottom right is a special datetime-type label. You can access it via
ax.XRuler.NodeChildren(1).String = 'test'
Messing with the labels might prompt the axis to remove that functionality.
Anyway, you need to show your script if you want a more precise answer.
3 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Time Series Objects dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!