Re: help - sticks plots of u,v/speed direction?? [message #18436] |
Wed, 12 January 2000 00:00 |
Pedro Velez-Belchi
Messages: 2 Registered: January 2000
|
Junior Member |
|
|
Jean Newman ha escrito:
> I have time-series of vectors u and v and wish to plot them along a time
> axis as sticks, a pretty standard plot for winds or current. Can anyone
> help me with how to go about this using IDL? Jean
>
Hello Jean hope the following lines can help you, any further trouble just
let me know:
;in dir should be the direction, diaj is the julian day (or any other time
indicator), velo is the array with the ;magnitude of the vector
s0=size(dir)
nc0= s0(1)
x00=FLTARR(nc0)
y00=FLTARR(nc0)
x10=FLTARR(nc0)
y10=FLTARR(nc0)
xmin0= min(diaj)-0.5
xmax0= max(diaj)+0.5
ymin0=-50.
ymax0=50.
diroffset=90.
dir=-dir+90-diroffset
sizex=10
; calcula coordenadas flechas
FOR i=0,nc0-1 DO BEGIN
x00(i)=diaj(i)
y00(i)=0.
x10(i)=x00(i)+velo(i)*COS(dir(i)*!DTOR) $
*((xmax0-xmin0)/(ymax0-ymin0))*(4./sizex)
y10(i)=y00(i)+velo(i)*SIN(dir(i)*!DTOR)
ENDFOR
PLOT, /DEVICE,[xmin0,xmax0], [ymin0,ymax0], $
xrange=[xmin0,xmax0], yrange=[ymin0,ymax0], xstyle=1, ystyle=1, $
xtitle='time(days) after 1 October 1996', ytitle='Wind velocity (m/s)',
$
title= title,/nodata
ARROW, /DEVICE, x00(0:nc0-1), y00(0:nc0-1), x10(0:nc0-1), $
y10(0:nc0-1), /DATA,/solid,hsize=0
end
|
|
|
Re: help - sticks plots of u,v/speed direction?? [message #18441 is a reply to message #18436] |
Tue, 11 January 2000 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Jean Newman (jcn@u.washington.edu) writes:
> I have time-series of vectors u and v and wish to plot them along a time
> axis as sticks, a pretty standard plot for winds or current. Can anyone
> help me with how to go about this using IDL?
I've been thinking about this a little bit, but I'm really
afraid of embarrassing myself. Do you have a reference to
a web page where I might see what a stick plot looks like?
I'm thinking this is really the kind of thing that lends
itself to object graphics.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|