# Re: [ferret_users] Help needed to draw arrow as a legend in a 2D vector diagram

Thank you very much for your reply. I tried the way you have suggested. It is working fine.

Thanks,
Sudev

On Thu, Jul 19, 2012 at 2:30 AM, jagadish karmacharya wrote:
Hi Sudev,

Try this:

vector/overlay/length=0.2/nokey/k=1/l=7/nolab/aspect/set tauu[d=1], tauv[d=2]
ppl veckey/nou,`0.1*(\$ppl\$xlen)` `1.05*(\$ppl\$ylen)` (f4.1, " m/s ")
ppl vector/ov,2,2

This should give you  --> 2.0 m/s at the top left corner of the plot.

Also,

And, one probabaly need to add aspect qualifier to "adjusts the direction of the vectors to compensate for differing axis scaling"

From: Sudev Das M P <devdas.pnr@xxxxxxxxx>
To: ferret_users <ferret_users@xxxxxxxx>
Sent: Wednesday, July 18, 2012 7:39 PM
Subject: [ferret_users] Help needed to draw arrow as a legend in a 2D vector diagram

Dear ferret users,
I have a script meant for plotting 2D vectors drawn over a shaded plot. The script will generate the required figure (please see the attached PDF file). After getting the plot, I would like to give the "arrow legend" to a user-specified place in the figure. I am not sure how to do this.

As shown in the following line, I gave the scale of arrow as "0.2 N/M**2 equal to 0.5 inch length". But I am not familiar how to draw the arrow legend after getting the vector plot. Please give me some suggestions how I can give the correct arrow label for my plot.

vector/overlay/length=0.2/nokey/XSKIP=2/YSKIP=2/k=1/l=7/nolab tauu[d=1], tauv[d=2]

The complete script is given below.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!---------------------------------------------------------------------------------
! Initialization
!---------------------------------------------------------------------------------
set mode verify !all commands are displayed on screen.
cancel window/all !eliminates graphics window from screen.
cancel region !cancel the current region.
cancel variable/all !delete all user defined variables.
cancel data/all !eliminates all data.
set mode meta

!---------------------------------------------------------------------------------
!---------------------------------------------------------------------------------
use "tauu.nc"
use "tauv.nc"

!---------------------------------------------------------------------------------
!Set Region
!---------------------------------------------------------------------------------
SET REGION/X=75E:100E/Y=5N:25N

!---------------------------------------------------------------------------------
!Set levels for display
!---------------------------------------------------------------------------------
define symbol t_levels = (-inf)(-0.16,0.18,.02)(inf)

!---------------------------------------------------------------------------------
! Plotting vector over shaded plot
!---------------------------------------------------------------------------------
fill/lev=(\$t_levels)/k=1/l=7/key/nolab tauu[d=1]

go fland

vector/overlay/length=0.2/nokey/XSKIP=2/YSKIP=2/k=1/l=7/nolab tauu[d=1], tauv[d=2]

!---------------------------------------------------------------------------------
!Writing labels
!---------------------------------------------------------------------------------
label/nouser `(\$ppl\$xlen)/5`, `(\$ppl\$ylen)-0.4`,0,0,0.16,JUL

label/nouser `(\$ppl\$xlen)/2`, `(\$ppl\$ylen)+0.2`,0,0,0.16,WIND STRESS VECTOR

!---------------------------------------------------------------------------------
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I would highly appreciate for some quick suggestions.

Sincerely,
Sudev