Thursday, May 2, 2013

A list of a few (very) useful GrADS scripts

As my second post, I am including a list of what I consider to be essential GrADS scripts for everyone's script library.  This list of scripts is not a master list containing script useful for a large number of unique GrADS applications, but rather a list of general scripts that are applicable to a wide range of uses.  Basically, scripts that everyone should have in their script folder.

Now, often times its nice to just put these scripts in the main GrADS folder, but I have a lot of my own scripts in there, so I made a separate sub-folder to contain these scripts, as they are often used in ALL of my other scripts, so it's nice to separate them.  Just remember, if you do this, you will need to include to full file path in your GrADS script; e.g., your command would be: 'useful_scripts/' vs. ''.

Colors and Color definition
    • This script is a basic script that defines a number of different colors and color shades, greatly increasing your color options is included with the basic color set defined when you start the program.
    • This is perhaps the most useful script for defining colors for GrADS available on the internet.  This script makes it easy to construct detailed and continuous color scales without having to write out long and complicated lists using the 'set clevs' and 'set ccols' command. can be used to make the plot below using the following set of commands:
                    'color -30 110 1 -kind white->fuchsia->indigo->blue->cyan->yellow->red->darkred'  
                    'd sfctemp' 
Surface temperature plotted on a continuous scale using

Color Bars
    • This script plots a very basic color bar either below, or to the right of your plot based on where you have the most available space.  This is perhaps the simplest way to plot a color bar in GrADS as it does not require you to pass any additional information.  However with simplicity comes limitations, more advanced color bar options will be addressed later on.
      • Other basic color bar scripts include:
        • (plots color bar with triangular ends -also a few command options)
        •   (same as cbarn, but better used with lots of colors -also a few command options)
        • (plots color bar as a fan in the corner. Example Here)
        • (recently added to the GrADS-aholic script library.)
      • While you certainly do not need all of these scripts in your library, they can certainly be useful from time to time 

    • This is another script from the folks who brought you, this script is very useful as it gives you nearly fully control of your color bar, from where it goes, to the type of ends it has, to how even text is plotted next to it, to whether or not it has lines, etc.  As you may have guessed, the color bar plotted in the surface temperature image was made with

Other Useful Scripts
    • This is another script from the group that developed and  This script is very useful if you want to include "hatching" in your plots.  This script is great, and includes a lot of versatility regarding the hatching style.  I included an example image made using  The major disadvantage to this script is that it is obnoxiously slow.  Therefore I don't recommend it for use with operational plotting (as this will take forever with more than one or two timesteps), but rather for making figures for papers or presentations.
      Example of Hatched plot using

    • is great for plotting base maps (more on base maps here).  This script (with associated .asc files) fills in land and water with different colors.  
That's all the basic scripts that I can think of for now.  Again, these are not necessarily scripts that are designed for specific purposes (e.g., plotting a sounding), but rather scripts that can be used to expand the plotting capability of the program itself.  Furthermore, many of the scripts that I upload to this site will require these scripts to function properly.  A more extensive list of scripts can be found here.

1 comment:

  1. Thank you for the script.
    How to use this script though?

    In my code I am running the script first and then issuing the command - color 1 10 -kind red->white -sample
    but no use.