MATLAB Autoscaling Issue for Constant Numbers
Show older comments
I have an array of very small constant numbers (0.0025). When I plot it, the autoscaled y-axis is [-1 1.5]. This 'zoomed out' scale makes the plotted line seem to be zero. I have used axis('tight') as well but it doesn't zoom in enough either.
t=[0:5]'; y=0*t + 0.0025; figure; plot(t,y);

If this is intended autoscaling behavior, it seems to be a poor design. Is there a way to change this behavior without defining my custom axis for every plot?
Note that if my data isn't constant, i.e. t=[0:5]'; y=0*t + 0.0025; y(3) = y(3) + eps; figure; plot(t,y);
The autoscaling is acceptable.

Answers (2)
Naman Chaturvedi
on 19 Sep 2018
0 votes
Awais Raza
on 19 Sep 2018
0 votes
1 Comment
Walter Roberson
on 19 Sep 2018
I agree that it appears to be a bug.
Categories
Find more on Graphics Objects 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!