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

Home » Public Forums » archive » Drawing vector fields with New Graphics
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: Drawing vector fields with New Graphics [message #85087 is a reply to message #85084] Tue, 02 July 2013 12:08 Go to previous messageGo to previous message
Gordon Farquharson is currently offline  Gordon Farquharson
Messages: 48
Registered: December 2010
Member
On Tuesday, July 2, 2013 11:15:00 AM UTC-7, Phillip Bitzer wrote:
> On Tuesday, July 2, 2013 12:54:36 PM UTC-5, Gordon Farquharson wrote:
> Chacun a son gout, ...

I have no idea how to pronounce it, but I like it :-)

> Not exactly what I was thinking. Defining v1 sets the "units" of the length_scale. You then set the "unit" to be 2 tics with v1.length_scale=2
>
> If instead of dividing the vx, vy by the magnitude, instead try
>
> v2.length_scale = 2/vmag
>
> I think this is what you're looking for....at least for this example.

Perfect! It works. Thanks very much for the suggestion. For reference (for others), here is the updated program.

PRO test_vector

x = [0.,1.,2.]
y = [0.,0.,0.]
vx = [1.,1.,1.]
vy = [1.,1.,1.]

vmag = mean(sqrt(vx^2 + vy^2))

v1 = vector(vx, vy, x, y, $
XTITLE='X', YTITLE='Y', $
XRANGE=[-1.,4.], YRANGE=[-1.,4.])

v1.arrow_thick = 2
v1.length_scale = 2

x = [1.,2.]
y = [1.,1.]
vx = [-0.5,-0.5]
vy = [-0.5,-0.5]

v2 = vector(vx, vy, x, y, $
/OVERPLOT, XRANGE=[-1.,4.], YRANGE=[-1.,4.])

v2.arrow_thick = 2
v2.length_scale = 2. / vmag

END

Thanks for the help.

(Maybe Mark or Chris could still comment on whether vector could be improved to provide a more intuitive interface.)

Gordon
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: peak analysis
Next Topic: IDLWAVE

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

Current Time: Fri Oct 10 04:12:31 PDT 2025

Total time taken to generate the page: 0.00223 seconds