Zoom behavior in figure embedded in GUI
3 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(2 个)
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.
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Exploration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!