comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: conflict between widget_draw and plot objects
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: conflict between widget_draw and plot objects [message #35550 is a reply to message #35549] Sat, 21 June 2003 00:19 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Charles wrote:

> Sorry, newbie question/problem.
>
> In this program I'm writing, the user can click a button which pops up
> an interface that allows them to select and view an image, and choose
> coordinates in that image, and then when they close, exports those
> coordinates back.
>
> The next stage for the user uses that same image, calculates the
> centroid of the object near the previously selected coordinates
> (selected in the previous window), does a line cut through the
> centroid, then shows a plot of the values in that line cut (using the
> plot command).
>
> That works fine.
>
> But, when I close the plot window, then go back to the first step of
> selecting/viewing an image, the pixel coordinates generated are really
> wierd, just way out there in neverland. I'm making the (possibly
> false) assumption that this has something to do with the plotting done
> in the second step. If I take out the plot line, I can go back to the
> first stage no problems.
>
> To get the pixel values I'm using:
>
> pix = (convert_coord(event.x,event.y,/DEVICE,/TO_DATA))[0:1]
>
> It seems to work fine, unless I've plotted something.
>
> I'm guessing somehow I'm capturing the wrong device coordinates or
> something, but I don't understand why.
>
> Any ideas?
>
> Thanks,
>
> -Charles

Dear Charles,

IDL uses system variables to store everything belonging to the last plot.
The coordination system, the ranges, the window size and so on.

But only for the last plot. If you switch to an other window where you want
to have different coordination established then you have to restore the
previous state of the system variables.

we have two routines which do this job.

http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/savesysvar_dbase.pro.html
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/restsysvar_dbase.pro.html


sys_var=savesysvar()
restsysvar,sys_var

regards

Reimar


--
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
[Message index]
 
Read Message
Read Message
Previous Topic: Function minimization in IDL/WAVE
Next Topic: EXTRACT_SLICE

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 07:19:35 PDT 2025

Total time taken to generate the page: 1.84055 seconds