display position arrays on an image [message #88790] |
Thu, 19 June 2014 13:52  |
g.nacarts
Messages: 148 Registered: November 2013
|
Senior Member |
|
|
Hi
I use the cgDrawVectors to make some position arrays of an image, and then plot them on a diagram. I was wondering if anyone knows how to plot these vectors on the top of the image instead of plotting them on a separate window.
Regards,
Gina
|
|
|
|
|
Re: display position arrays on an image [message #88794 is a reply to message #88790] |
Fri, 20 June 2014 04:54   |
g.nacarts
Messages: 148 Registered: November 2013
|
Senior Member |
|
|
I am using the tvscl command to display the image. But I tried the save command and I just had the position vectors. The image is not shown anywhere.
My code was like this:
cgDisplay, 550, 550
cgimage, image, /save
cgDrawVectors, x, y, pos_x, pos_y,fraction=0.001, /ORDERED
|
|
|
Re: display position arrays on an image [message #88795 is a reply to message #88794] |
Fri, 20 June 2014 09:32   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
g.nacarts@gmail.com writes:
> I am using the tvscl command to display the image. But I tried the save command and I just had the position vectors. The image is not shown anywhere.
> My code was like this:
>
> cgDisplay, 550, 550
> cgimage, image, /save
> cgDrawVectors, x, y, pos_x, pos_y,fraction=0.001, /ORDERED
>
Try setting the SCALE keyword on cgImage.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
|
|
|
|
|
|
|
|
Re: display position arrays on an image [message #88811 is a reply to message #88790] |
Mon, 23 June 2014 03:43   |
g.nacarts
Messages: 148 Registered: November 2013
|
Senior Member |
|
|
I used the VECCOLORS keyword to make the vectors but it always be black or white. I used information from here to create the color: http://www.idlcoyote.com/color_tips/getcolor.php
My code is like this:
Yellow = [255,255,0]
cgDrawVectors, x, y, pos_x, pos_y,fraction=0.001, VECCOLORS= yellow, /ORDERED, /OVERPLOT
The vectors are still white.
|
|
|
Re: display position arrays on an image [message #88812 is a reply to message #88811] |
Mon, 23 June 2014 08:54  |
Phillip Bitzer
Messages: 223 Registered: June 2006
|
Senior Member |
|
|
On Monday, June 23, 2014 5:43:38 AM UTC-5, g.na...@gmail.com wrote:
> I used the VECCOLORS keyword to make the vectors but it always be black or white. I used information from here to create the color: http://www.idlcoyote.com/color_tips/getcolor.php
>
>
> Yellow = [255,255,0]
>
> cgDrawVectors, x, y, pos_x, pos_y,fraction=0.001, VECCOLORS= yellow, /ORDERED, /OVERPLOT
>
>
>
> The vectors are still white.
I think you need to read a little more carefully:
VECCOLORS in optional
A scalar or vector of colors the same size as velx. May be bytes, short integers, or strings. Bytes and short integers are treated as indices into the current color table. The default is "opposite".
You're providing short integers, so it's reading indices.
Either put the colors you want in the current color table, or simply provide the string(s) of the color:
cgDrawVectors, x, y, pos_x, pos_y,fraction=0.001, VECCOLORS= 'yellow', /ORDERED, /OVERPLOT
|
|
|