Hi -
If you're overlaying a vector on a gridded variable then it's better to
define the U and V components of the variable on the grid, just at that
one location. Then Ferret can draw the arrow.
Say you want to put the vector at x=320,y=14, and that the vector
components are u=6,v=8. Here is an example using coads_climatology
sst.
! Open the file and make the underlay plot.
use coads_climatology
shade sst[l=1]
! define variables for the location and size of the vector
components.
let xloc = 320
let yloc = 14
let uval = 6
let vval = 8
! Define short axes, with the middle point at the location of the
vector
define axis/x=`xloc-5`:`xloc+5`:5/units=degrees xax
define axis/y=`yloc-5`:`yloc+5`:5/units=degrees yax
! Define variables, with the middle point having the value of the
vector
! components, and the other points missing.
let uvar = {,`uval`,}
let vvar = {,`vval`,}
! Make 2-Dimensional variables with the center point taking the
vector component values.
let u = reshape(uvar,x[gx=xax]) + 0*y[gy=yax]
let v = reshape(vvar,y[gy=yax]) + 0*x[gx=xax]
vector/over u,v
Then the VECTOR command can have any of the qualifiers to control the
line thickness, whether it is labeled and so forth.
Renato Parkinson Martins wrote:
Hi Ansley,
thank you very much for your help.
Actually, I need to overlay this vector plot on a SSH field plot. I
will try the way you recommended.
Regards,
Renato
2009/5/28 Ansley Manke <Ansley.B.Manke@xxxxxxxx>
Hi Renato,
In order to use the VECTOR command you need to have a grid, but that
grid could be quite simple. It depends a bit on what you're plotting
this on. Are you overlaying it on some plot?
One idea is to just draw an arrow, with PLOT/VS/OVER commands - would
that do what you want? Here's a simple little example to show you the
idea. If this isn't what you're thinking about write back with more
information about what you want to do.
yes? use etopo60
yes? fill rose ! just as an underlay plot
! define locations for the shaft of the arrow.
yes? let xline = {340,354}
yes? let yline = {29,29}
yes? plot/nolabel/over/vs/line/thick/color=black xline,yline
! define locations for the headof the arrow.
yes? let xhead = {350,354,350}
yes? let yhead = {31,29,27}
yes? plot/nolabel/over/vs/line/thick/color=black xhead, yhead
You could define the points to draw this in whatever location and
direction you want. This is a very non-general way to do this. Ferret
can take care of the length and rotation of the vector automatically,
but you would need to have vector components on a grid.
Ansley
Renato Parkinson Martins wrote:
Dear all,
I'll would like a help on plotting a vector u,v on a single coordinate
lon,lat, which is not gridded. Does anybody know a way for doing this?
Thank you very much.
Regards,
Renato
|