[Thread Prev][Thread Next][Index]

[ferret_users] Color Palette Viewer : an easy to use script

Hi Feretters,
                Did you ever feel like "oh no....this default color
scheme is not suitable for this plot"? And, it is too time consuming
to explore other palette files in ferret/ppl directory? Here is an
easy solution.....use palette_viewer! 

    Use palette_viewer.jnl (see attachment), with your dataset and 
desired color /LEVELS to choose good palettes from a given list. Make
the list of palette files from ferret/ppl directory (recent versions
of Ferret comes with more than 100 palette files!)

Use this tool and pick the best color scheme for your plot,
especially to use in presentations and publications.........



Useful information on palette files
 User Manual : Ch6 Sec5.2. Shade and fill colors 
               Ch1 Sec7.   UNIX TOOLS    Fpalette
               Ref Sec20.  PALETTE 

 Scripts/GO  : try_palette
 Web :

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

\ cancel mode verify
! Description : jnl script to see and choose desired pallets from a given
!                   list, for a specific variable/field.
! NOTES : 1. Needs a Ferret version which supports /RANGE qualifier to 
!               REPEAT command.
!         2. Follow the instructions to make a list of good palettes :
!               press  s  and  ENTER   to SAVE  and  just  ENTER  to skip.
!         3. Input : a list of palette files to be tested (palt_list, see below)
!            Output: a list of selected palette files (my_palettes, see below)
! Written By : Jaison Kurian
! Written On : 13/June/2007
     use coads_climatology

     set reg/l=6                    ! set your desired region here

     define symbol var  = uwnd[d=1] ! variable to be plotted; use respective
                                    !   dataset number since we load one 
                                    !   more data file soon
     define symbol flev = (-16,16,1)! /LEVELS for fill command, always choose
                                    !   the final levels you want to use

     ! Suppose you are in  /home/myname/ferret_files and 
     !   Ferret is installed at /usr/local/ferret.
     !   Then list the *.spk files and save the output to a text file 
     !      (without the path) as
     ! [user@machine]$ cd /usr/local/ferret/ppl
     ! [user@machine]$ ls *.spk > /home/myname/ferret/palette_list.txt
     ! [user@machine]$ cd /home/myname/ferret
     ! and enter the txt file name against pal_list

     define symbol palt_list = palette_list.txt

     ! below, enter the desired output txt file name, which will contain
     !    all selected palette file names

     define symbol my_palettes = my_palettes.txt  
     let npaletts = {spawn:"cat ($palt_list) | wc -l"}

     define axis/x=1:`npaletts`:1 xfile
     define grid/x=xfile   gfile

     FILE/grid=gfile/FORMAT=DELIMITED/TYPE="TEXT"/var="spk"  "./($palt_list)"   

     sp rm -f ($my_palettes)
     REPEAT/RANGE=1:`npaletts`:1/NAME=pp (            ;\
          define symbol pp1 = `pp`                    ;\
          let plt = "`spk[d=($palt_list),i=($pp1)]`"  ;\
          fill/pal=`plt`/lev=($flev)                   \
             /title="PALETTE    :     `plt`" ($var)    ;\
          say "  Press   s  and  ENTER  to SAVE   or  just  ENTER  to  SKIP" ;\
          let choice = "`{spawn:"head -1"}`"          ;\ 
          let option = DNCASE(choice)                 ;\
          IF `option EQ "s"` THEN                     ;\
             list/nohead/format=(2x,a)/file=($my_palettes)/append/quiet  plt ;\
          ENDIF                                       ;\
     cancel data ($palt_list)

[Thread Prev][Thread Next][Index]

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

Privacy Policy | Disclaimer | Accessibility Statement