[Thread Prev][Thread Next][Index]

Re: [ferret_users] Palette with different colours about a fixed point



Samrat,

| Sorry for the late reply, but to me it seems that the setting up of the
| colour palette by percentages can give shades of blue to red about zero only
| if the upper and lower limits of the levels qualifier are equal.
[. . .]
| palette it is possible to always have shades of blue below 0 and shades of
| red above 0. This enables me to use the same palette each time without
| making any changes to it regardless of how negative or how positive the
| limits are.

I see. 

[1] If all you want is to avoid specifying a max and min of
shading levels, you can use "/lev=3.0C", for example, to ensure the
levels are centered around zero.

[2] If you truly want asymmetric levels or if you want to avoid the
LEVEL qualifier altogether, you might want do something like this:

   let positive = if yourvar gt 0 then yourvar
   let negative = if yourvar lt 0 then (-1)*yourvar

   fill/palette=redscale  positive
   fill/palette=bluescale negative

where redscale ranges from white to red and bluescale from
white to blue.

This method is not perfect.  You'll see zigzag edges
around zero values because "positive" and "negative
have missing values there.

[3]Or, you could "stretch" either the positive or negative part
so that both have the same range:

  let fakefield = if yourvar gt 0 then 3*yourvar else yourvar
  fill/palette=your_blue_and_red_shading  fakefield

if you know that the positive maximum is 1/3 of the negative
maximum.

[4] If you want a full automation, I guess you have to generate
your palette on the fly, as Russell suggested.  I can't write
such a script off the top of my head, but basically you

1. examine the max and min of the field you are going to plot,
2. compute contour levels, and
3. create and write to a palette file from within Ferret.

This is doable but probably complicated.

[5] Anybody? . . .

Regards,
Ryo


[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement