[Thread Prev][Thread Next][Index]

Re: [ferret_users] how to define the color key in plot command

Hi Ansley,

Yes, of course. I was thinking of the title to the plot. All that was needed was the creation of variable with meaningful names.  I had a nagging feeling that something wasn't quite right with my answer after I submitted it.

Would it be worth looking at an addition to to the LET command? Say,

let/legend="foo with spaces" bar=...


let/label="foo with spaces" bar=...

and, if set, the legend/label attribute is used in place of the variable name. 


On 03/02/15 04:32, Ansley Manke wrote:
Hi Russ,
The auto-generated legend is always labeled with the variable names not their titles.  The example you give labels the lines with t_surf and t_bot.  So, one could make variable names that are more descriptive,
let/title="Surface Temperature" surface_temp=temp[z=15]
let/title="Bottom Temperature" bottom_temp temp[z=1]
plot Surface_Temp, Bottom_Temp
Or, for more control, there are several scripts that have been contributed over the years.  These place a line legend on the plot in locations that you can control in the script.  Have a look at the scripts and how they are run:
yes? go/help legend
yes? go/help test_legend ! a demo script that shows how legend.jnl is called
yes? go/help legline
yes? go/help legline_nu

On 2/1/2015 3:16 PM, Russ Fiedler wrote:

Hi Sara,

The quickest and easiest way is just to define a new variable with the title attribute.

let/title="Surface Temperature" t_surf=temp[z=15]
let/title="Bottom Temperature" t_bot=temp[z=1]
plot t_surf,t_bot  ! Rather than plot temp[z=15],temp[z=1]

The new titles will be used to label the lines.


On 01/02/15 06:07, 'Sara Sari' via _OAR PMEL Ferret Users wrote:
Thank you William but it is not what I want, the graph and the keys are OK. I just want to know to write "surface temp" instead of temp[z=15] (which is written by the ferret itself). just that.

On Saturday, January 31, 2015 1:43 PM, William S. Kessler <william.s.kessler@xxxxxxxx> wrote:

It is easy.

Either choose from a long list of built-in or user-contributed files or make your own.

* built-in. These are the .spk files in /usr/local/ferret/ppl
  See a demo of these with palette_demo.jnl (from inside Ferret)
  Also see the documentation under 'palette'.
  Also http://ferret.pmel.noaa.gov/static/FAQ/graphics/colorpalettes.html

* make your own. Create a file palette_name.spk
Its simplest format has a list of lines in free format, each line giving 4 numbers:
percent red green blue
All values are 0-100. Percent is along the range of values; if you don't specify via /LEV=, these will be the smallest-to-largest values of your data. First one should be 0, last 100. Next three are percents of R-G-B for that level. Ferret will interpolate between the levels given.

An example is my blue-to-gray-to-red palette:

0  20  20  100
49  85  85  85
51  85  85  85
100 100  20  20

For specific cases you might want RGB_Mapping_By_Value, which allows you to specify specific colors for specific values (see documentation).

* Invoke a palette by

PAL palette_name

or, e.g., SHADE/PAL=palette_name ...


> On Jan 31, 2015, at 8:56 AM, 'Sara Sari' via _OAR PMEL Ferret Users <ferret_users@xxxxxxxx> wrote:
> Hi friends,
> Could you please let me know how I can redefine the color key? it is automatically  generated by the program while I want to define it by myself. actually I want to have them but define it in a way that I want.
> for example redefining the black one  as " surface temp" (instead of temp[z=15])  and the red one "bottom temp" (instead of temp[z=1]).
> Thank you,
> Sara

> <temp.png>

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

Privacy Policy | Disclaimer | Accessibility Statement