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 
Return to the default flat view Create a new topic Submit Reply
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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
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: Mon Dec 01 06:05:21 PST 2025

Total time taken to generate the page: 1.12559 seconds