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

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

2 Comments

Hello, What do you mean? I don't understand your comment :(

Sign in to comment.

 Accepted Answer

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))

More Answers (0)

Categories

Products

Release

R2020a

Tags

Asked:

BN
on 16 Nov 2020

Commented:

on 16 Nov 2020

Community Treasure Hunt

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

Start Hunting!