How can I start my axis from 0 but keep the max limit automatic?
177 views (last 30 days)
Show older comments
y-axis of my plot starts from negavite values but I want it to start from zero. I can not know the max value until I execute the code. Since I will be using the code for many data, I have tried to use ylim, v= axis...Thank you in advance for your help
0 Comments
Accepted Answer
More Answers (1)
Adam
on 15 Aug 2014
Edited: Adam
on 15 Aug 2014
Probably not the neatest solution ( Azzi Abdelmalek's solution is better! ), but you could just use the auto limits each time you update/refrseh your plot, then immediately afterwards set the lower x limit to 0.
e.g.
ylims = get( hAxes, 'Ylim' )
ylims(1) = 0;
set( hAxes, 'Ylim', ylims )
See Also
Categories
Find more on Axis Labels in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!