!

How to use Ferret Color Palettes

Below is an annotated version of the script palette_demo.jnl


! palette_demo.jnl

! Description: demonstration of V5.0 palette capabilities

! set up for demo
 yes? SET DATA levitus_climatology
yes? SET REGION /@T
yes? SET WINDOW/ASPECT=1.2:axis
yes? DEFINE VIEWPORT/y=0:.33 low
yes? DEFINE VIEWPORT/y=.33:.67 mid
yes? DEFINE VIEWPORT/y=.67:1 up


Palettes
As of Ferret version 5 there are 3 types of palettes: PERCENT, BY_LEVELS, and BY_VALUES. All palettes consist of a list of RGB color values and associated with each RGB value another value that determines how to map the color onto the "Z axis" of the plot. Previous to V5 all palettes behaved like PERCENT palettes.

From the Unix prompt you can use  Fpalette '*'  to see the available palettes.

 
> Fpalette '*'

  * * * * * * * * in ferret/ppl 
  black.spk:
  blue.spk:
  bluescale.spk:
  brown.spk:
  centered.spk:
  dark_land_sea.spk:
  dark_terrestrial.spk:
  default.spk:
  gray.spk:
  grayscale.spk:

(etc.)
 
>Fpalette -more rnb2
 
  * * * * * * * * in ferret/ppl 
    0.    0.    0.   50.
   13.    0.    0.  100.
   40.    0.   98.  100.
   67.   97.  100.    3.
   93.  100.    3.    0.
  100.   76.    0.    0.

Here are examples using a PERCENT palette:
yes? PALETTE rainbow
yes? ppl list shaset

yes? set view upper; go magnify 1.2
yes? FILL/levels=10 temp[z=0]; go land thick

yes? set view lower; go magnify 1.2
yes? FILL/lev=20 temp[z=0]; go land thick
 
> Fpalette -more rainbow_by_levels 

  * * * * * * * * in ferret/ppl
  RGB_Mapping By_level
 
  ! Level    Red  Green   Blue
        1   80.0    0.0  100.0
        2   30.0   20.0  100.0
        3    0.0   60.0   30.0
        4  100.0  100.0    0.0
        5  100.0    0.0    0.0
        6   60.0    0.0    0.0
Here are examples using a BY_LEVELS palette:
yes? PALETTE rainbow_by_levels
yes? ppl list shaset

yes? set view upper; go magnify 1.2
yes? FILL/levels=(15,30,2.5) temp[z=0]; go land thick

yes? set view lower; go magnify 1.2
yes? FILL/lev=(15,30,.5) temp[z=0]; go land thick
 
> Fpalette -more ocean_temp

  * * * * * * * * in ferret/ppl 
  RGB_Mapping By_value
 
  ! SetPt    Red  Green   Blue
     -2.0   80.0    0.0  100.0
      0.0   30.0   20.0  100.0
     10.0    0.0   60.0   30.0
     20.0  100.0  100.0    0.0
     30.0  100.0    0.0    0.0
     35.0   60.0    0.0    0.0

  

In this example, using a BY_VALUE palette, we see sequence of ocean temperature plots at increasing depth.
Note how the colors adjust themselves to the temperature values.

yes? PALETTE ocean_temp
yes? ppl list shaset

yes? set view up; go magnify 1.5
yes? FILL/Z=0 temp; go land thick

yes? set view mid; go magnify 1.5
yes? FILL/Z=50 temp; go land thick

yes? set view low; go magnify 1.5
yes? FILL/Z=200 temp; go land thick

  


oar.pmel.contact_ferret@noaa.gov 25 June, 1999
404 Not Found

Not Found

The requested URL "/footer.txt" was not found on this server.