[Thread Prev][Thread Next][Index]

Re: fill_between

On Fri, 2 Apr 2004, Patrick Brockmann wrote:
> I have noticed that the fill_between script does not run properly (no
> action) when I use a vertical axis indicated as depth.
> yes? def axis/z=1:100:1/depth myzaxis
> yes? let a=sin(z[gz=myzaxis]/10)
> yes? plot a
> yes? go fill_between poly/over/palette=red/nolab a myzaxis -2
Hi Patrick,
	Here is a slightly "lame" fix to the /depth problem with
fill_between. I suspect there are better ones.

! suppose for one reason or another you have data on a /depth axis
def axis/z=1:100:1/depth myzaxis
let a=sin(z[gz=myzaxis]/10) ; plot a
go fill_between poly/over/palette=red/nolab a myzaxis -2

! the line is plotted but the shading is missing, while if you
! drop the /depth all is well

! suppose you output the "data" to a file in reverse order then read
! it back in on a grid with negative values (the minuses on the
! vertical axes can be supressed later
sp touch reversed.data
   (list/nohead/form=(f10.4)/file=reversed.data/app/k=`101-k` a)

def axis/z=-100:-1:1 zrev ; def grid/z=zrev grev
file/form=free/var=arev/g=grev reversed.data
plot/set arev ; ppl axlsze,,-0.15 ; ppl plot
go fill_between poly/over/palette=red/nolab arev zrev -2
plot/o/nolab/line=16 arev

The purpose of the extra step "ppl axlsze,,-0.15 ; ppl plot"
is to remove the annoying minus signs.  When used with a
negative height value, the "ppl axlsze" command reverses
the signs of the axis values.

You had another question of the polygon outline being eliminated.
This could be fixed by replotting the curve(s) after the polygon,
perhaps with a thicker pen, as above.

Hope this helps,

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement