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

1 visualización (últimos 30 días)
song fu
song fu el 9 de Oct. de 2022
Comentada: song fu el 11 de Oct. de 2022
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

Respuestas (1)

Simon Chan
Simon Chan el 9 de Oct. de 2022
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 comentarios
song fu
song fu el 9 de Oct. de 2022
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 el 11 de Oct. de 2022
I finally find the Box style was missed Clipping check. Thanks all the same

Iniciar sesión para comentar.

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by