[Thread Prev][Thread Next][Index]

Re: set color of contoue lines



Hi -
Actually LINE does control whether lines are dashed or not, even on a CONTOUR command without FILL. If you want solid lines where they would otherwise be dashed, LINE will make them solid, but it does not control color.

PEN can be used to change colors as Jaison says, but another simple way is to get different types and colors of contour lines is to use CONTOUR/COLOR= and /OVELAY to get different colors for different sets of levels

contour/lev=(0,30,3)/color=red flx
contour/over/lev=(-30,-3,3),dash(-30,-3,3)/color=blue flx

Dash lines are the default type for negitive contour levels, so the DASH above is not really needed. You could use LINE to make them solid:

contour/lev=(0,30,3)/color=red flx
contour/over/lev=(-30,-3,3),line(-30,-3,3)/color=blue flx

Ansley

Jaison Kurian wrote:

Hi Gao Rongzhen,
The demo files in ferret/examples dir illustrates the
different options available with ferret and their usage. For contouring
purpose, please have a trial with the demo file "custom_contour_demo.jnl".

yes? go custom_contour_demo

The "LINE" sub-qualifier with "LEVELS" will work only with "CONTOUR/FILL"
(or with the alias "FILL"). So with just the command "CONTOUR" the "LINE"
qualifier will be ignored. Instead you can use "PEN" to control the color.
Have a look at the example below.

Hope This Helps

With Regards

Jaison

!----------------example.jnl----------------
\cancel mode verify
!
! create a 2-D variable : from custom_contour_demo.jnl

define axis/x=-20:20:1 x2020
define axis/y=-20:20:1 y2020
define grid/x=x2020/y=y2020 g2020
set grid g2020
let circle = (x^2 + y^2) ^ 0.5
let/title="SAMPLE FUNCTION" my_var = circle * exp((10-(i+j))/50)-10

! different options with CONTOUR command

! the LINE qualifier in this case will be ignored
cont /lev="(-10,20,1),line(1,20,1,2),dash(-10,-1,1,4)" my_var
pause

! the default way
cont/lev=(-10,20,1) my_var
pause

! +ve values in RED solid lines & zero and -ve values in BLUE dashed lines
cont/lev="(-10,20,1,-1) PEN(-10,0,1,4) PEN(1,20,1,2) DASH(-10,0,1)" my_var
pause

! +ve values in RED solid lines, -ve values in BLUE dashed lines &
! zero in BLACK thick line
cont/lev="(-10,20,1,-1) PEN(-10,-1,1,4) PEN(1,20,1,2) PEN(0,0,1,7) DASH(-10,-1,1)" my_var

!-------------------------end of example.jnl----------------------------

On Sun, 8 May 2005, Gao wrote:

Hi Ferreters,

Now i have a problem about color of contour lines. What i want is values above 0 is red solid line, and below 0 is blue dashed line. But i used the following script the color argument doesnot work. All the contour lines were black.How should i do?

def sym level3="(-30,30,3),line(0,30,3,2),dash(-30,0,3,4)"
contour/set/nolab/lev=($level3) flx


Thanks

Gao Rongzhen








[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement