[Thread Prev][Thread Next][Index]

[ferret_users] pyferret - opacity, fill color for polygon command



Hi ferreters,

I have tested some new features from the last pyferret 1.0.0
and especifically about controls on opacity and color definition.
Now I am wondering how to produce filled color plots with some opacity
(a feature that is widely used in plots that show spreads, as IPCC projections plots for example).

From the following example:
yes? def axis/x xaxis=i[i=1:100]
yes? let a1=SIN(x[gx=xaxis]/10)+0.3
yes? let b1=COS(x[gx=xaxis]/10 +10)
yes? let a2= a1+0.3
yes? let b2= b1+0.3
yes? plot/line=1/nolab a1,a2, b1,b2

How to fill between a1 and a2 with a first color and
between b1 and b2 with another color, with transparency ?

If you use
yes? plot/nolab/line=1 a1,a2, b1,b2
yes? go fill_between poly/over/palette=green/opacity=10 a1 xaxis a2
yes? go fill_between poly/over/palette=red/opacity=10 b1 xaxis b2
you get as attached image small lines surrounding each polygon.
--> polygon1.png
Verified by a simple
yes? let a={20,80,50}
yes? let b={10,20,60}
yes? polygon/fill/hlim=0:100/vlim=0:100/lev=(0,10,1)/opacity=10 a,b,1
yes? polygon/fill/hlim=0:100/vlim=0:100/lev=(0,10,1)/opacity=10/o a+3,b+3,1
yes? polygon/fill/hlim=0:100/vlim=0:100/lev=(0,10,1)/opacity=10/o a+6,b+6,1
--> polygon2.png

Another feature that would be great, could be the possibility to defined the filled color that is used by the polygon command from a qualifier as the qualifier color with 4 quartets. Currently, you need to define a palette file even for a single color definition.

Let me know, if I have missed something on this graphic topic
or if there are easy workarrounds.

Happy new year at all.
Regards
Patrick

--
LSCE/IPSL, Laboratoire CEA-CNRS-UVSQ
Data Analysis and Visualization Engineer
ICMC - IPSL Climate Modelling Centre
--

Attachment: polygon1.png
Description: PNG image

Attachment: polygon2.png
Description: PNG image


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement