In a Matlab plot(x,y) having both negative and positive 'y' values, how to display the xtick labels at zero(0) line too
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
In the sample image, I would like to have xtick labels at 0 line too.
0 commentaires
Réponses (1)
Jos (10584)
le 20 Fév 2018
Modifié(e) : Jos (10584)
le 20 Fév 2018
The word too implies showing the tick labels twice ... This just repositions the axis, which is what you're after, I think:
ah = subplot(2,1,1) ;
plot(rand(20,1), randn(20,1), 'bo' ) ;
set(ah,'XAxisLocation','origin')
4 commentaires
Jos (10584)
le 23 Fév 2018
I have never seen that in any proper data graph. Why do you want to do that? To me, it seems that it will be confusing. You could add gridlines as an alternative, using grid on, for instance.
Voir également
Catégories
En savoir plus sur Axis Labels 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!