how to set the negative values on a diagram to zero
3 次查看(过去 30 天)
显示 更早的评论
hello all,
could you kindly advise me how to set a limit on a diagram.
As you may see on the diagram that i have plotted, the orange graph tends to show negative value.
I wish to set a limit on the y-axis to zero, so that there are no more negative value appearing on the diagram.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/311753/image.png)
0 个评论
回答(1 个)
Star Strider
2020-6-7
One approach:
figure
plot( ... )
ylim([0, max(ylim)])
if you only want to limit the y-axis range.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!