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

Home » Public Forums » archive » display position arrays on an image
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
display position arrays on an image [message #88790] Thu, 19 June 2014 13:52 Go to next message
g.nacarts is currently offline  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 #88791 is a reply to message #88790] Thu, 19 June 2014 13:53 Go to previous messageGo to next message
g.nacarts is currently offline  g.nacarts
Messages: 148
Registered: November 2013
Senior Member
When I said on top of the image I mean on the image not on top it was a typo.
Re: display position arrays on an image [message #88792 is a reply to message #88790] Thu, 19 June 2014 15:24 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
g.nacarts@gmail.com writes:

> 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.

Set the SAVE keyword on the cgImage command that displays the image.
This will establish the image "coordinate" system. (You may have to use
the XRange and YRange keywords to get this set up as you need it.)
cgDrawVectors will draw itself in whatever coordinate system has been
set up for it.

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 #88794 is a reply to message #88790] Fri, 20 June 2014 04:54 Go to previous messageGo to next message
g.nacarts is currently offline  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 Go to previous messageGo to next message
David Fanning is currently offline  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 #88801 is a reply to message #88790] Sat, 21 June 2014 12:11 Go to previous messageGo to next message
g.nacarts is currently offline  g.nacarts
Messages: 148
Registered: November 2013
Senior Member
I tried SCALE keyword but still the same as before I can only visualise the vectors not the image.
Re: display position arrays on an image [message #88802 is a reply to message #88801] Sat, 21 June 2014 12:31 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
g.nacarts@gmail.com writes:

> I tried SCALE keyword but still the same as before I can only visualise the vectors not the image.

Ah, probably need to set the OVERPLOT keyword on cgDrawVectors.

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 #88803 is a reply to message #88790] Sat, 21 June 2014 12:43 Go to previous messageGo to next message
g.nacarts is currently offline  g.nacarts
Messages: 148
Registered: November 2013
Senior Member
I didn't use any keyword in cgimage. I just use the /overplot keyword in cgDrawVectors and it displays the vectors on the image. Thanks David :)
Re: display position arrays on an image [message #88804 is a reply to message #88790] Sat, 21 June 2014 12:49 Go to previous messageGo to next message
g.nacarts is currently offline  g.nacarts
Messages: 148
Registered: November 2013
Senior Member
This question it might be silly but I was wondering if we are able to change the color of the arrows using the cgDrawVectors function (the default color is white).
Re: display position arrays on an image [message #88806 is a reply to message #88804] Sat, 21 June 2014 20:25 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
g.nacarts@gmail.com writes:

> This question it might be silly but I was wondering if we are able to change the color of the arrows using the cgDrawVectors function (the default color is white).

Yes, it is a bit silly when all the documentation about these routines
is built into the header of the file itself, and is available on-line:

http://www.idlcoyote.com/idldoc/cg/index.html

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 Go to previous messageGo to next message
g.nacarts is currently offline  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 Go to previous message
Phillip Bitzer is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: read lambert projected image
Next Topic: IDL 8.2 IDL_IDLBridge & abortion

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

Current Time: Wed Oct 08 15:06:49 PDT 2025

Total time taken to generate the page: 0.00708 seconds