Interactive plotting [message #4970] |
Mon, 04 September 1995 00:00  |
philp
Messages: 1 Registered: September 1995
|
Junior Member |
|
|
Hi All,
Does anybody knows a widged based package for IDL 3.6.1 that allows to
interactively draw a 2D (3D?) plot and then allows to modify its axis range, X
and Y labels, change colors, annotate with text and eventualy print it (or
save as postscript)? I know that Sterner's package has some of the tools to
annotate for example but I was wandering if someone has a complete
interactive plotting package.
Furthermore, I'm also looking for a program to draw a contour plot (color
filled + levels) together with its associated color bar and legend. The tool
in Sterner lib (bar) works fine interactively on screen but fails once you
want to output the postscript file because it works in device coordinates.
Thanks
Philippe Peeters
Belgian Institute for Space Aeronomy
3 Avenue Circulaire
B-1180 Brussels
Tel : +32-2-373.03.81
Fax : +32-2-374.84.23
Email : philp@oma.be
|
|
|
Re: Interactive plotting [message #8957 is a reply to message #4970] |
Tue, 20 May 1997 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
John Harlander writes:
> Can someone point me to a method for interactively extracting and plotting a
> row or a column from two-dimensional data? I recall watching someone do this
> in IDL. The image was put on the screen and the cursor was used to
select the
> row or column.
I will be very disappointed, John, if you don't hear from about
500-600 people who have written this program in one of my
IDL programming classes. :-)
Here is an non-widgetized example program called ROWCOL.
There is an IDL library program called PROFILES that does
about the same thing.
Cheers!
David
------------------------------------------------------------ ---
PRO ROWCOL, image
ON_ERROR, 1
IF N_ELEMENTS(image) EQ 0 THEN MESSAGE, 'You must pass an IMAGE parameter.'
; Get image size.
s = SIZE(image)
xsize = s(1)
ysize = s(2)
; Open an image window the right size. Display image.
WINDOW, XSIZE=xsize, YSIZE=ysize, /FREE, TITLE='Image Window'
imageWindow = !D.WINDOW
TVSCL, image
; Create a window for the profile plots.
WINDOW, XSIZE=500, YSIZE=300, /FREE, TITLE='Profile Window'
profileWindow = !D.WINDOW
col = xsize / 2
row = ysize / 2
; Make the display window the current window.
WSET, imageWindow
; Initialize the !MOUSE.BUTTON system variable.
!MOUSE.BUTTON = 0
; Set window up for two plots.
!P.MULTI = [0, 2, 1, 0, 1]
; Go into your loop.
WHILE !MOUSE.BUTTON NE 4 DO BEGIN
; Draw the profiles in the profile window.
WSET, profileWindow
PLOT, image(col, *), TITLE='Column Profile', $
YRANGE=[MIN(image), MAX(image)], $
XRANGE=[0,xsize], XSTYLE=1, $
XTITLE='Column ' + STRTRIM(col, 2), YTITLE='Pixel Value'
PLOT, image(*, row), TITLE='Row Profile', $
YRANGE=[MIN(image), MAX(image)], $
XRANGE=[0,ysize], XSTYLE=1, $
XTITLE='Row ' + STRTRIM(row,2), YTITLE='Pixel Value'
; Make the image window the current window.
WSET, imageWindow
; Get the cursor location.
CURSOR, col, row, /DEVICE
ENDWHILE
; Turn off !P.MULTI system variable.
!P.MULTI = 0
END
------------------------------------------------------------ --------
----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
Customizable IDL Programming Courses
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
|
|
|