[Thread Prev][Thread Next][Index]

[ferret_users] Re: plotting numerical values of all points on map



On Mon, 1 Aug 2005, Audrey Eun wrote:
> I've tried:
> let xx=x[g=V]; let yy=y[g=V]
> REPEAT/X=103:105 (REPEAT/Y=2:4 (LET xyvalue=PT[L=1,K=1,X=`XX`,Y=`YY`];
> LABEL/OVERLAY `XX`,`YY`,-1,0,0,0.06 "`xyvalue`"))

Hi Audrey,
	I wrote in haste and should have been more explicit or given
a complete demo..
The commands
	let xx=x[g=V]; let yy=y[g=V]
tell ferret to define xx and yy as the x-axis and y-axis values of
the grid of a variable named V.  In your case it appears that
you are dealing with a variable named PT and so you would use
	let xx=x[g=PT]; let yy=y[g=PT]
At this point you could check that you have what you expect by
	list/x=103:105 xx
which should give all the grid points between these axis limits, and
likewise for yy.

There is another error in what you attempted - there is ome too many
arguments in your "label" command, which when I tested it results in
virtually invisible labels. I suspect you didn't intend the second
zero. The syntax is
	label xval yval align rot size text
and the /over is not necessary.

Finally there is an oversight, which I didn't notice until I ran a
test. Normally I only use "repeat/i=" rather than "repeat/x=" so
don't need an increment. There is nothing in "repeat/x=103:105" that
tells ferret that "x" is the axis of the variable PT so it defaults
to the increment 1. You need "repeat/x=103:105:0.083333" or to look
at the output of "show grid/x PT" and decide the range of "i" you
desire (and likewise for j).

Here is a complete demo - try it out as it works as is for me.
Mick

! define x,y axes like yours with dummy z,t axes
def axis/x=103:105/npoints=25 xax ; def axis/y=2:4/npoints=25 yax
def axis/z=1:1:1 zax ; def axis/t=1:1:1 tax

! define a grid (in your case the grid comes from the dataset I suspect)
def grid/x=xax/y=yax/z=zax/t=tax grd

! now define a function on this grid
let PT=x[g=grd]+y[g=grd]+0*(z[g=grd]+t[g=grd])-100
! and the axis variables
let xx=x[g=PT] ; let yy=y[g=PT]

! make an underlay plot
shade/nolab PT[k=1,l=1]

! and add the labels (2 figures after decimal in this case)
REPEAT/X=103:105:0.083333 (REPEAT/Y=2:4:0.083333 \
  (LET xyvalue=int(100*PT[L=1,K=1,X=`XX`,Y=`YY`])/100; \
  LABEL `XX` `YY` -1 0 0.06 "`xyvalue`"))



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement