velovect function

107 views
Skip to first unread message

Rob

unread,
May 10, 2020, 10:06:54 AM5/10/20
to idl-pvwave
Hello,

I just plotted a map of wind vectors using this function, velovect.

VELOVECT, u_wet(*,*), v_wet(*,*), loni, lati, LENGTH=1, color='0', /overplot

But, it seems that is not possible to plot a legend outside showing a vector, like a reference magnitude for the plot... am I right ?

Thanks.

Wayne Landsman

unread,
May 10, 2020, 9:24:12 PM5/10/20
to idl-pvwave
I think it would be much easier to use the function graphics function VECTOR http://www.harrisgeospatial.com/docs/VECTOR.html added in IDL V8.0.     As Mike Galloy pointed out many years ago, there are several vector field plotting functions in direct graphics but they all have significant limitations.     https://michaelgalloy.com/2008/03/19/overview-of-flow-visualization-in-idl.html

Anyway, for VELOVECT, I might do something like the following:


IDL> u = randomn(seed,20,20)                       

IDL> v = randomn(seed,20,20)                       

IDL> velovect,u,v                                  

IDL> len  = max([max(abs(u)),max(abs(v))])   ;Maximum in U or V direction        

IDL>  arrow,9.5,-2,10.5,-2,/data         ;Plot Unit vector          

IDL>  xyouts,10.5,-2,string(len,f='(f6.2)') + ' units'    ;Show units for length of 1


I had to look in the VELOVECT code to clarify that the unit vector length was the maximum in *either* the U or V direction



Wayne Landsman

unread,
May 10, 2020, 9:34:57 PM5/10/20
to idl-pvwave
One additional comment.   The "Additional Example" in the  documentation for the LEGEND function gives an example of how to add legend for a VECTOR field plot.

Reply all
Reply to author
Forward
0 new messages