Data is not contained within x-axis limits

1 vue (au cours des 30 derniers jours)
Andy Wang
Andy Wang le 19 Fév 2021
Modifié(e) : Adam Danz le 22 Fév 2021
All,
So essentially I have an issue where if I zoom into a plot through a scroll wheel or a box, some of the data displayed extends past the x-axis limits as shown in the picture below.
The plot is located within an application I am building using App Designer. Do I need to reset the xlim or something within a callback function?
Insights would be greatly appreciated.
Thanks.
  1 commentaire
Mario Malic
Mario Malic le 20 Fév 2021
This shouldn't happen, it's a bug, maybe you could contact customer service.
When it does happen, try resizing the app. Maybe you could create a button that triggers drawnow and see if it helps.

Connectez-vous pour commenter.

Réponses (1)

Adam Danz
Adam Danz le 20 Fév 2021
Modifié(e) : Adam Danz le 22 Fév 2021
Get the handle to the line object and look at the Clipping property. If it's set to 'off' figure out what part of the code changed it from the default 'on' and fix it or just set it to on.
If clipping wasn't the issue, check that there isn't an invisible axis that hosts the line object. Get the line object handle and use ax=ancestor(h,'axes') to get the parent axes of the line object. Then delete the axes using delete(ax). If you still see the axes then you know you've just deleted an invisible axes with a larger extent than the visible axes.
If you've ruled out the clipping problem and invisible axes, contact tech support: Contact Us - MATLAB & Simulink
Example of clipping issue:
x = 0 : .01 : 10;
y = rand(size(x));
h = plot(x,y);
ylim([-5,5])
h.Clipping = 'off';
xlim([2,8])

Catégories

En savoir plus sur Graphics Object Programming dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by