How to shift the y-axis and force it to start at another number rather than 0?

18 Ansichten (letzte 30 Tage)
Dear all,
I have this:
But I need to see what is the plot if the horizontal axes cross value is -3 like this (with same as above data):
How I can do this?
Thank you

Akzeptierte Antwort

Ameer Hamza
Ameer Hamza am 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))

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by