Re: TVimage and PlotS [message #40779] |
Thu, 26 August 2004 07:32  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
James writes:
> But I still didn't clearly understand... I want to plot not lines,
> but dots (or circles). And I have an array of data with coordinates (X,Y).
> How it will work in this case ?
Well, neither of the commands you are using will establish
a data coordinate system for you, so I presume the data is
in device coordinates, is that right? Suppose they are (I
can't imagine anything else.) Let's call them "image" coordinates,
since they probably correspond to points on the image.
(The lack of information from you allows the imagination
to run wild here!)
You can convert them to NORMALIZED coordinates like this:
c = Convert_Coord(x, y, /Device, /To_Normal)
xx = c[0,*]
yy = c[1,*]
Now, you have to scale them into the position of the image
in the window.
xxx = Scale_Vector(xx, pos[0], pos[2])
yyy = Scale_Vector(yy, pos[1], pos[3])
Now, you could draw them on your image:
PLOTS, xxx, yyy, /Normal
You will have to grab SCALE_VECTOR:
http://www.dfanning.com/programs/scale_vector.pro
Of course, all this is bogus if your X and Y vectors don't
correspond to my imagination. (Well, uh, good chance there.)
You could tell us more about them. :-)
> I tried to apply your advise but I didn't get a line across the window...
Well, uh, somebody wrote this:
PLOTS, [pos[0], pos[1]], [pos[1], pos[3]], /Normal
And, of course, they meant this:
PLOTS, [pos[0], pos[2]], [pos[1], pos[3]], /Normal
Sorry. :-(
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|