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

Home » Public Forums » archive » Backlogged question: Drawing vector fields with same scaling in 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
Backlogged question: Drawing vector fields with same scaling in New Graphics [message #92230] Mon, 02 November 2015 18:02 Go to previous message
tianhuachengyue is currently offline  tianhuachengyue
Messages: 7
Registered: November 2015
Junior Member
This is an unsolved problem about the vector() function in IDL. Gordon used to post this question on the site:
http://compgroups.net/comp.lang.idl-pvwave/drawing-vector-fi elds-with-new-graphics/2090071

But actually it wasn't quite solved:
Is there a way to plot (using New Graphics) two different vector fields on the same set of axes such that the vector fields have the same scaling? Below is a minimal working program. What I want (and sort of expect) is that the v2 vectors be proportionally scaled with respect to the v1 vectors. What I get is that the v2 vectors appear smaller than the v1 vectors, even though they are clearly the same in magnitude.

I followed the suggestions to set v1.length_scale = 2 and
vmag = mean(sqrt(vx^2 + vy^2)),
then set v2.length_scale = 2. / vmag to try to let v2 have the same scale as v1. But clearly it didn't help... Please see my codes below.
Anyone can help me out? Thanks!

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 = [-1.0,-1.0]
vy = [-1.0,-1.0]

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

END

Huazeng
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: I want to plot the rainfall data on the image.
Next Topic: cgImage trim

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

Current Time: Wed Oct 08 13:55:04 PDT 2025

Total time taken to generate the page: 0.00398 seconds