How to shift the y-axis and force it to start at another number rather than 0?
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Dear all,
I have this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/415263/image.jpeg)
But I need to see what is the plot if the horizontal axes cross value is -3 like this (with same as above data):
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/415268/image.jpeg)
How I can do this?
Thank you
2 commentaires
Réponse acceptée
Ameer Hamza
le 16 Nov 2020
You can change the yticklabels() to show the values you want. For example
rng(0);
lower_value = -3;
x = randn(1, 10);
y = x - lower_value;
bh = bar(y);
yticklabels(string(yticks+lower_value))
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Annotations 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!