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

Home » Public Forums » archive » Re: Use of Cursor
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Use of Cursor [message #78908] Thu, 12 January 2012 05:43
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
DavePoreh writes:

> Perfect answer. i will follow that to get the result.

If you followed that with some cash it is would be
much more likely to get done in our lifetimes. :-)

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.")
Re: Use of Cursor [message #78910 is a reply to message #78908] Thu, 12 January 2012 05:38 Go to previous message
d.poreh is currently offline  d.poreh
Messages: 406
Registered: October 2007
Senior Member
On Jan 12, 2:32 pm, David Fanning <n...@dfanning.com> wrote:
> DavePoreh writes:
>> i am also interested to do so, and what i have in my mind is, how
>> could we define a keyboard push (for instance ctrl+r) that every time
>> we push that the cursor would be activated and ready to get x-y
>> coordinates. Any suggestion?
>
> Matlab?
>
> Well, in theory, this could also be done in any object
> oriented implementation in IDL. In fact, it is probably
> already possible in IDL 8 graphics. I've built applications
> in my Catalyst Library that allow the XY coordinates of
> any object shown in the window to be reported. See,
> for example, the DataViewer program, which can have up
> to 64 images shown in the display window, each reporting
> its own position and value as you move your cursor
> over them.
>
> All it requires is that an object "know" its position
> in a graphics window, have some knowledge about its
> own coordinate scaling, and have some capability of
> being selected by the user.
>
> I don't think the Cntl-R thing is every going to be
> implemented, but gaining knowledge of the graphic in
> the window is certainly possible someday, if not now.
>
> Come to think of it, it would probably take 5 minutes
> to implement something like this for cgWindow, if I
> didn't have to worry about multiple plots in the
> display window. :-)
>
> 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.")

Perfect answer. i will follow that to get the result.
Cheers,
Dave
Re: Use of Cursor [message #78911 is a reply to message #78910] Thu, 12 January 2012 05:32 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
DavePoreh writes:

> i am also interested to do so, and what i have in my mind is, how
> could we define a keyboard push (for instance ctrl+r) that every time
> we push that the cursor would be activated and ready to get x-y
> coordinates. Any suggestion?

Matlab?

Well, in theory, this could also be done in any object
oriented implementation in IDL. In fact, it is probably
already possible in IDL 8 graphics. I've built applications
in my Catalyst Library that allow the XY coordinates of
any object shown in the window to be reported. See,
for example, the DataViewer program, which can have up
to 64 images shown in the display window, each reporting
its own position and value as you move your cursor
over them.

All it requires is that an object "know" its position
in a graphics window, have some knowledge about its
own coordinate scaling, and have some capability of
being selected by the user.

I don't think the Cntl-R thing is every going to be
implemented, but gaining knowledge of the graphic in
the window is certainly possible someday, if not now.

Come to think of it, it would probably take 5 minutes
to implement something like this for cgWindow, if I
didn't have to worry about multiple plots in the
display window. :-)

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.")
Re: Use of Cursor [message #78912 is a reply to message #78911] Thu, 12 January 2012 00:40 Go to previous message
d.poreh is currently offline  d.poreh
Messages: 406
Registered: October 2007
Senior Member
On Jan 12, 5:06 am, Craig Markwardt <craig.markwa...@gmail.com> wrote:
> On Jan 11, 9:47 pm, singlebinary <singlebin...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
>> Hello All,
>
>> I am a beginner IDL user. I would like to make use of the cursor to
>> read the x and y coordinates on a plot. I would like to read twice. I
>> searched online and wrote a program of my own (see below). There are
>> two problems with the program: (1) it does not give me the value on
>> the plot but rather the pixel value; (2) it simply does not work
>> unless I close the graphics window. It then outputs -1 -1.
>
>> Please do guide me in this regard. Thanks!
>
>> PRO cursor_use
>>   x = findgen(1000)*0.01
>>   y = sin(x)
>>   PLOT, x, y
>>   n = 2
>>     FOR i = 0, n-1 DO BEGIN
>>       CURSOR, x, y, /DEVICE, /WAIT
>>       PRINT, "This is cursor position", x,y
>>       PRINT, "Click again..."
>>     ENDFOR
>> END
>
> If you want pixel coordinates use /DEVICE, but if you want data
> coordinates, then don't use /DEVICE.
>
> Craig

Guys
i am also interested to do so, and what i have in my mind is, how
could we define a keyboard push (for instance ctrl+r) that every time
we push that the cursor would be activated and ready to get x-y
coordinates. Any suggestion?
Cheers,
Dave
Re: Use of Cursor [message #78914 is a reply to message #78912] Wed, 11 January 2012 20:06 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Jan 11, 9:47 pm, singlebinary <singlebin...@gmail.com> wrote:
> Hello All,
>
> I am a beginner IDL user. I would like to make use of the cursor to
> read the x and y coordinates on a plot. I would like to read twice. I
> searched online and wrote a program of my own (see below). There are
> two problems with the program: (1) it does not give me the value on
> the plot but rather the pixel value; (2) it simply does not work
> unless I close the graphics window. It then outputs -1 -1.
>
> Please do guide me in this regard. Thanks!
>
> PRO cursor_use
>   x = findgen(1000)*0.01
>   y = sin(x)
>   PLOT, x, y
>   n = 2
>     FOR i = 0, n-1 DO BEGIN
>       CURSOR, x, y, /DEVICE, /WAIT
>       PRINT, "This is cursor position", x,y
>       PRINT, "Click again..."
>     ENDFOR
> END

If you want pixel coordinates use /DEVICE, but if you want data
coordinates, then don't use /DEVICE.

Craig
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: New Graphics: Layout and Position
Next Topic: Re: postscripts with multiplot on a Mac

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

Current Time: Fri Oct 10 22:40:12 PDT 2025

Total time taken to generate the page: 0.64095 seconds