Re: Pan/Zoom Line Plots with Coyote Graphics [message #80222 is a reply to message #80153] |
Mon, 21 May 2012 14:11   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> At my new job, we had a need to be able to zoom into a
> lot of data very quickly and then pan around the data
> to see what points are in the immediate vicinity.
I modified this Zoom/Pan program this morning to add
more functionality. There is now a multiple REDO functionality
to go along with the multiple UNDO functionality that was
previously in the program.
Also, I added the ability to "adjust" the Y range of the
zoomed-in plot, to accommodate the minimum and maximum
data values of the data in the X range view of the data.
Combined with the UNDO/REDO, this gives you a way to zoom
into the data very closely, but to back out to see an "overview"
of the actual data in the view's X range, then UNDO that to return to
your close-in view of the data itself. The data adjustment,
UNDO, and REDO can be done with buttons in the pull-down menu
or by using accelerator keys (very fast!!). We use this
to good effect with lidar data.
I also realized that people might want to use this
functionality in their own widget programs. (So you could
look at multiple files, for example.) So, I have added a
PARENT keyword that allows you to specify your own parent
widget for this display window. Essentially, this program
becomes an interactive Zoom/Pan line plot window in your
own program. (It is a compound widget object, if you like.)
Here is a very simplified program that demonstrates how to
do this.
PRO Test
tlb = Widget_Base(Title='My Program')
cgZPlot, cgDemodata(1), PSYM=2, Color='dodger blue', Parent=tlb
Widget_Control, tlb, /Realize
Widget_Control, 'myprogram', tlb, /NoBlock
END
You can download the updated program here:
http://www.idlcoyote.com/programs/cgzplot.pro
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|