[Thread Prev][Thread Next][Index]

Re: Ferret: fill colors between two lines



Hi Gao Rongzhen,
I think there are several ways to do this ( not sure about fill_between.jnl, it needs atleast one curve). If you
don't mind to define one more viewport and few more variables..it
is done !!!! Have a trial with the script below. Plese find the details
inside the script.

Hope This Helps

With Regards

Jaison

!---------script starts here--------------------------
\ cancel mode verify

define axis/t=1789:1992/npoints=204 t2
define grid/t=t2 g2
file/var=aa/grid=g2 test.asc
set window/size=1/aspect=1.294
def view/xlim=0.1,0.92/ylim=0.3,0.7 v11
def view/xlim=0.1,0.92/ylim=0.3,0.7 v12 ! same as above, but different name

! set some values, the accuracy of the plot will depend on these

let ylo = -15 ! lo for Y-axis
let yhi = 15 ! hi for Y-axis
let tlo_cut = 1880 ! t-value for first line
let thi_cut = 1920 ! t-value for second line

! to get the color fill between the lines

set view v11 ! the first viewport
define axis/y=`ylo`:`yhi`:1 yax
let dummy = t[gt=t2]*0 + y[gy=yax]
let dummy1 = IF t[gt=dummy] GE `tlo_cut` AND t[gt=dummy] LE `thi_cut` THEN dummy
fill/ov/nokey/nolab/lev=(`ylo`,`yhi`,`yhi-ylo`)/noaxes/pal=grey dummy1

! to get the lines

plot/ov/nolab/vs/noaxes/line/color=3 y[gy=yax]*0+`tlo_cut`, y[gy=yax]
plot/ov/nolab/vs/noaxes/line/color=4 y[gy=yax]*0+`thi_cut`, y[gy=yax]

! to get the actual plot

set view v12 ! the second viewport
plot/nolabel/line=8/vlim=`ylo`:`yhi`/set aa
ppl axlabp -1,-1
ppl tics .08,.12,.08,.12
ppl yfor "(i3)"
ppl yaxis -15,15,2.5
ppl axlsze,0.2,0.2
ppl txlsze,0.2
ppl plot

!-----end of script-----------------------------------

On Tue, 14 Jun 2005, Gao Rongzhen wrote:


Hi, All

I have an annual mean time series ranging from 1789 to 1992. Now i want to add two vertical lines at t=1775 and t=1785, and fill coclors (gray) between them. I try to use fill_between.jnl, but failed. Can anyone give me some hints to get it? Thanks a lot.
------------------------------------

define axis/t=1789:1992/npoints=204 t2
 define grid/t=t2 g2
 file/var=aa/grid=g2 d:\test.asc
 set window/size=1/aspect=1.294
 def view/xlim=0.2,0.82/ylim=0.4,0.7 v11

 set view v11
 plot/nolabel/line=8/set aa[l=1:204]
 ppl axlabp -1,-1
 ppl tics .08,.12,.08,.12
 ppl yfor "(i3)"
 ppl yaxis -15,15,2.5
 ppl axlsze,0.2,0.2
 ppl txlsze,0.2
 ppl plot
 frame/file=test.gif

------------------------------------

GRZ

--
___________________________________________________

    Jaison Kurian
    Centre for Atmospheric and Oceanic Sciences
    Indian Institute of Science
    B A N G A L O R E   560 012
    Ph: +91-80-22932505 Extn. 229
        +91-80-23600450
    Fax:+91-80-23600865
___________________________________________________

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement