Zoom behavior in figure embedded in GUI

조회 수: 4 (최근 30일)
Sara
Sara 2014년 10월 22일
답변: Image Analyst 2014년 10월 22일
I have built a GUI that contains some axes and created a pushbutton to let the user zoom in and out of the image. I can't figure out how to control the zoom properties though. If I plot in a figure outside the GUI, when I zoom in the portion of the original figure that lays outside the axes is not plotted anymore. When I plot in the axes embedded into the GUI, all the elements of the figure are still visible after zooming in and part of the is outside the axes limits. I have attached an image to explain what I mean. Is there a way to show only the portion inside the axes for axes within a GUI?
Thanks in advance

답변 (2개)

Adam
Adam 2014년 10월 22일
What is the value of the 'Clipping' property of both the axes and the objects in question?
By default axes clipping should be on so unless you have switched it off this doesn't sound like a problem.
However, the individual objects also have a 'Clipping' property which will determine whether the object is clipped or not.
I cannot tell from your screenshots, but are the shapes that are entirely outside of the zoomed axes also still plotted somewhere on the GUI or is it just shapes some part of which lies still within the zoomed axes which are still showing.
If it is the latter then I would guess that they have 'Clipping' set to off. I'm not familiar with plotting shapes like what you show on axes though (I tend to plot images or line plots mostly and they clip as they should by default) so I may be incorrect in that guess.
  댓글 수: 2
Sara
Sara 2014년 10월 22일
The clipping is on for both the patches and the axes. The axes are included in a panel and the patches are shown till the panel border (larger than the axes).
Sara
Sara 2014년 10월 22일
Found! It was a problem with the renderer, painters instead of zbuffer, but thanks.

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


Image Analyst
Image Analyst 2014년 10월 22일
You need to use imscrollpanel(). Attached is a demo that I got from the Mathworks image processing team (that I spiffed up a little). Sorry it's not simpler but this is their recommended way.

카테고리

Help CenterFile Exchange에서 Visual Exploration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by