using convert_coord with multiple plotting windows [message #36982] |
Mon, 10 November 2003 13:25 |
jbattat
Messages: 8 Registered: November 2003
|
Junior Member |
|
|
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
|
|
|