How can I start my axis from 0 but keep the max limit automatic?
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
Accepted Answer
More Answers (1)
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 )
Categories
Find more on Axes Appearance 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!