|
Re: using convert_coord with multiple plotting windows [message #36979 is a reply to message #36975] |
Mon, 10 November 2003 22:42  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Dear James,
I remember this was discussed more as three times in the past.
http://groups.google.de/groups?hl=de&lr=&ie=ISO-8859 -1&q=savesysvar+group%3Acomp.lang.idl-pvwave&btnG=Go ogle+Suche&meta=group%3Dcomp.lang.idl-pvwave
Here is a short description what happens and one solution.
If you do a plot in a window the coordination transformation matrix is
stored in several systemvariables. If you have one output window all is
fine because always the last coordination transformation matrix is the
actual one which is used for the current window.
If you have more windows then the systemvariables stored only the last
coordination transformation matrix for the last plot in the last created
used window. This is the situation you are recognizing now. This is all
right.
What to do?
store the system variables by sacesysvar for each plotdevice window after
the coordination are defined
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/savesysvar.tgz
Then if you switch back to the window restore the systemvariables by
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/restsysvar.tgz
More about our library you'll find here:
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
best regards
Reimar
James wrote:
> I have a widget that contains 2 draw widgets, say plot1 and plot2,
> (used for x-y data plotting). The user can select a rubber band box
> to choose a zoom window on either draw widget.
>
> When the user chooses a rubber band box, the box coordinates are
> returned in device units (event.x and event.y). To achieve the zoom,
> I use convert_coord to convert device units to data units and then
> replot with new xrange and yrange keywords.
>
> However, convert_coord "can only provide valid results if a window is
> open and current." (IDL 5.5 doc)
>
> This means that if plot2 is created after plot1, then convert_coord
> will only be valid for rubber band boxes drawn on plot2.
>
> I'd like the rubber band box to be valid in both plotting windows,
> regardless of the order plot generation!
>
> Is there a way to have convert_coord refer to the device/data
> coordinates of a previous plot, or to refresh the device/data
> conversion buffer (if that's the way it works)?
>
> Alternatively, is there a way to get the mouse event to return data
> coordinates (there's nothing that I've seen in the doc that suggests
> yes)? Or some other way to get xy ranges in data units for two (or
> more) plots?
>
> Thanks very much in advance,
> James
--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
|
|
|