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/script.gs' vs. 'script.gs'.
Colors and Color definition
- Rgbset.gs
- 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.
- Color.gs
- 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. Color.gs can be used to make the plot below using the following set of commands:
'd sfctemp'
Surface temperature plotted on a continuous scale using color.gs |
- Cbar.gs
- 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:
- cbarn.gs (plots color bar with triangular ends -also a few command options)
- cbarm.gs (same as cbarn, but better used with lots of colors -also a few command options)
- cbarc.gs (plots color bar as a fan in the corner. Example Here)
- diamondbar.gs (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
- Xcbar.gs
- This is another script from the folks who brought you color.gs, 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 xcbar.gs.
Other Useful Scripts
- Hatch.gs
- This is another script from the group that developed color.gs and xcbar.gs. 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 hatch.gs. 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 hatch.gs
- Basemap.gs
- Basemap.gs 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.
Thank you for the script.
ReplyDeleteHow 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.
Thanks
That's wonderful, and well done.
ReplyDeleteThank you so much for this website.
Hi, how marked high and low pressure center as 'H' and 'L' in GRADS respectively .
ReplyDeletePlease the commands ?