1

I have a GUI with two axes. The first one for original image while the second one is for interpolated image.

First in my code, I use imrect to select part of the original image and then I crop that part using imcrop . After that I display the cropped image in both axes.

What I want is to know how to zoom in the first axes (the original image) and it shows the same zooming the second axes ( interpolated image ) automatically.

Thanks a lot in advance.

1 Answers1

1

It is not clear the relationship between the two actions you mention in your question:

  • using imrect and imcrop to work on the image

  • zooming on one axes and have the same zoom on the second

A possible solution to automatically apply the zoom made on the first axes to the second one could be using the linkaxes built-in function.

If in your GUI you have two axex with, respectively, tag axes1 and axes2, you can add the following statements in the GUI OpeningFcn

linkaxes([handles.axes1 handles.axes2])

This allows automatically applying the zoom you make on axes1 also to axes2.

Hope this helps.

il_raffa
  • 5,090
  • 129
  • 31
  • 36
  • thanks for your help, it works perfectly. I will explain to you the relationship, the original image is very huge, so that I choose part of it and then crop it show it in both axes. After that I would like to zoom on that part (original) and have the same zoom on the second axes by using Linkaxes that you told me to use. Thus thank you a lot. – future_engineer Sep 12 '15 at 10:04