changing y limit of a plot

5 views (last 30 days)
LUI PAUL on 4 Apr 2015
Commented: Image Analyst on 5 Apr 2015
i have x column matrix...the plotting is to change y axis limit between 0 to 1 not changing x values? please help....

Accepted Answer

Image Analyst
Image Analyst on 5 Apr 2015
Use the ylim() function to set the limits of the y axis:
y = y / max(y); % Normalize y
bar(x, y);
ylim([0, 1]);
Image Analyst
Image Analyst on 5 Apr 2015
You're welcome. Go ahead and officially "Accept this answer" then. Thanks in advance.

Sign in to comment.

More Answers (1)

dpb on 4 Apr 2015
I presume you mean to normalize the values as simply changing the y-axis limits on the plot would just leave a solid blob across the whole, precisely, to compute that is dependent upon how you have the data that made the plot which you haven't revealed...
  1 Comment
LUI PAUL on 5 Apr 2015
Edited: LUI PAUL on 5 Apr 2015
y lim is 0 to 450..and i want to make the limit 0 to 1 with out effecting the x values.that means 450/450=1;0/450=0;actually i want to normalize the data amounts,not the values.

Sign in to comment.


Find more on Vector Fields in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by