GUI: Text note scrolls outside axes limits
조회 수: 2 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
채택된 답변
Joseph Cheng
2015년 5월 8일
편집: Joseph Cheng
2015년 5월 8일
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')
PS. quick google search also lead me here http://www.mathworks.com/matlabcentral/answers/94127-why-do-text-objects-on-plots-move-outside-axes-boundaries-when-using-the-pan-functionality
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Object Programming에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!