Borrar filtros
Borrar filtros

Zoom behavior in figure embedded in GUI

3 visualizaciones (últimos 30 días)
Sara el 22 de Oct. de 2014
Respondida: Image Analyst el 22 de Oct. de 2014
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

Respuestas (2)

Adam el 22 de Oct. de 2014
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 comentarios
Sara el 22 de Oct. de 2014
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 el 22 de Oct. de 2014
Found! It was a problem with the renderer, painters instead of zbuffer, but thanks.

Iniciar sesión para comentar.

Image Analyst
Image Analyst el 22 de Oct. de 2014
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.


Más información sobre Visual Exploration en Help Center y File Exchange.


Community Treasure Hunt

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

Start Hunting!

Translated by