GUI: Text note scrolls outside axes limits

1 vue (au cours des 30 derniers jours)
CAM
CAM le 8 Mai 2015
Commenté : CAM le 8 Mai 2015
I have a an axes object within a GUI that displays digital on/off data. I have added a text note to each rising edge showing its index in the sequence (i.e., Edge01, Edge02, etc). Due to the number of rising edges and the length of the data vector, users often use zoom and pan when inspecting the data.
My problem is that when the user has zoomed in on a section of data, then pans left/right, the text notes do not disappear with the data when they move outside the x-axis limits. Actually the text notes pan off the axes into the figure area. This does not happen with zoom. How can I remedy this? Matlab and Google searches result in the empty set.
Thanks in advance.

Réponse acceptée

Joseph Cheng
Joseph Cheng le 8 Mai 2015
Modifié(e) : Joseph Cheng le 8 Mai 2015
Well what you need to do is turn clipping on.
x = 1:10;
y = randi(10,1,10).^2;
figure,plot(x,y);
yble = y>=50;
h = text(x(yble),y(yble),'a','clipping','on')
  1 commentaire
CAM
CAM le 8 Mai 2015
Face-palm .
Can't believe I missed that in the help-documentation. Thanks.
(I swear I tried a dozen combinations of keywords in my searches, but did not find the link you provided. Thanks for the additional information).

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

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

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by