how to prevent plotting more curve than the axis limit in app uiaxes

조회 수: 2 (최근 30일)
song fu
song fu 2022년 10월 9일
댓글: song fu 2022년 10월 11일
app.Curve_sim.XLim=[-(b1+2) 0];
app.Curve_sim.YLim=[0 (a1+2)];
one can find more plots below 0@Y while the YLim is still above 0

답변 (1개)

Simon Chan
Simon Chan 2022년 10월 9일
Put those data below your limit to NaN.
x=1:50;
y=randi([-5,25],1,50);
threshold = 0;
y(y<threshold)=NaN; % Set those value below your limit to NaN
plot(x,y);
  댓글 수: 2
song fu
song fu 2022년 10월 9일
Thanks very much!
Your answer is available. However, X axis limit is effective, I wonder whether more direct solution can fix this problem.
At other code, the Y limit is also effective. I did not find a difference between this one and the other.
song fu
song fu 2022년 10월 11일
I finally find the Box style was missed Clipping check. Thanks all the same

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by