Re: IDL equivalent to MATLAB's linkaxes [message #92100 is a reply to message #92041] |
Wed, 14 October 2015 02:12   |
braveheart197315
Messages: 4 Registered: October 2015
|
Junior Member |
|
|
On Friday, 2 October 2015 21:32:08 UTC+1, Helder wrote:
> On Friday, October 2, 2015 at 9:48:57 PM UTC+2, Gordon Farquharson wrote:
>> Hi All
>>
>> Is there a canned IDL equivalent to MATLAB's linkaxes command [1], or is this something one would have to implement by updating each figure's xrange and yrange properties when some zoom event occurs? If the latter, would using the EVENT_HANDLER property for the image function [2] be the best way to go?
>>
>> Gordon
>>
>> [1] http://www.mathworks.com/help/matlab/ref/linkaxes.html?refre sh=true
>> [2] http://www.exelisvis.com/docs/graphicseventhandler.html
>
> Hi,
> I've always wanted this and could not realize it 100%. The reason is the following: when you use the event handler of FG, you have to write functions that catch the event (for instance "mouse wheel" for zoom), do whatever processing and then if you end the function with:
>
> 1) return, 0: then IDL won't process the specific event at all (no zooming will be performed)
>
> 2) return, 1: then IDL will process the event normally (zooming will be performed)
>
> So now you have two ways out of this:
>
> a) make use of option 1) from above and process the event yourself. This means zoom the image yourself.
>
> b) make use of option 2) and with a delay (timer) do some post-event processing.
>
> I tried to do this for the zoom for a completely different problem (moving annotation on the image with the image when zooming and panning) and I found in the course of this another problem that I reported here: http://idl.marchetto.de/annotations-on-images/
> Nevertheless you might still find it useful. For example, one of the most important things you need to know to handle the zoom is the zooming factor. In FG this is given by:
> zoomFactor = (Delta gt 0) ? 1.25d : 1/1.25d
> where Delta is given in the call to the function:
> function WheelEvent, oWin, xPos, yPos, Delta, KeyMods
>
> In case you're going for the pan option too, what you could do, is process the mouse up option. First make notice if you're dealing with pan (mouse pressed + move), then in the mouse up function, get the new axes values and send them over to the other plot.
>
> Hope it helps and if you find a better solution, plz let me know.
>
> Regards,
> Helder
Dear Helder
I would like to write you because I need help about IDL program. Can you send me your email please( my email braveheart197315@yahoo.com)
Best Regard
N.S.David
|
|
|