!
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.)
|
- PERCENT palettes consist of an ordered sequence of
RGB values representing a piecewise continuous path through color
space. For a given plot with N contour levels the set of discrete
colors used are determined by interpolating to N-1 equally spaced
points along this path.
From the Unix prompt try, for example, Fpalette
-more rnb2 to see an example
of a PERCENT palette file.
>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
|  |
- BY_LEVELS palettes specify a list of invariant RGB
color. The colors given in the list are exactly the colors that
will be used on the plot -- no interpolation of colors is used.
This is particularly useful for hard copy, where printers may
be "fussy" about which colors look best. If the number
of colors required for the plot exceeds the number given in the
palette the colors are repeated starting from the first color
as necessary. Note that this is the same logic used for pattern
files.
From the Unix prompt try, for example, Fpalette
-more rainbow_by_levels to
see an example of a BY_LEVELS palette file.
> 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
|  |
- BY_VALUE palettes specify a path through color space,
much as does a PERCENT palette. However, the logic used to interpolate
colors along the path is based on the data values of the the
contour levels. With such a palette the color representing, say,
25 degree temperature will be the same whether the temperature
range on the plot is large or small and whether 25 degrees lies
at the lower end of the range or the upper.
From the Unix prompt try, for example, Fpalette -more ocean_temp to see an example of
a BY_VALUE palette file.
> 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 FoundNot Found
The requested URL "/footer.txt" was not found on this server.