Skip to main content
  • Home
  • Documentation
  • FAQ
  • Downloads
  • Support
  • Current Release Notes
  • Ferret Users Guide
    • Users Guide Index
    • Commands Reference
    • 1. Introduction
    • 2. Data Set Basics
    • 3. Variables & Expressions
    • 4. Grids & Regions
    • 5. Animations & Gif Images
    • 6. Customizing Plots
    • 7. Handling String Data Symbols
    • 8. Working with Special Data Sets
    • 9. Computing Environment
    • 10. Converting to NetCDF
    • 11. Writing External Functions
    • Glossary
    • Appendix A: Functions
    • Appendix B: PPLUS Guide
    • Appendix C: Ferret-Specific PPLUS Enhancements
  • Previous Release Notes
  • Tutorials and Demos
    • Ferret Tour
    • DSG files: Discrete Sampling Geometries Demo
    • Ferret sorting demo
    • Fast Fourier Transforms demo
    • Empirical Orthogonal Functions demo
    • Ferret objective analysis demo
    • Ferret Palette Demo
    • Map projections
    • Ferret polygon vector demo
    • Ferret Graticules demo
    • Ferret Polytube Demo
    • Ferret Polymark Demo
    • Ferret Constant-Array demo
    • Ferret land_detail demo
    • COADS Tour
    • Levitus Tour
    • Use OPeNDAP
    • Ferret binary read demo
  • PyFerret
    • PyFerret Downloads and Install
    • What is PyFerret?
    • Why use PyFerret?
    • PyFerret for the Ferret user
    • PyFerret command syntax: quick-start notes
    • PyFerret for the Python user
    • Graphics in PyFerret ?
    • New Ferret functionality
    • PyFerret Python functions and constants
    • PyFerret Python objects and methods
    • Ferret external functions in Python
    • Ferret Fortran external functions
    • PyFerret metadata-and-data dictionaries
  • OPeNDAP
    • OPeNDAP usage in Ferret
    • Use OPeNDAP Demo
    • Test OPeNDAP

Ferret Graticules demo

How to use Ferret graticule qualifiers /GRATICULE /HGRATICULE /VGRATICULE

Below is an annotated version of the script graticules_demo.jnl

The /GRATICULE, /HGRATICULE and /VGRATICULE qualifiers forplot commands turn on and control the line type for graticulelines at the tic marks of the axes.

/GRATICULE sets the horizontal and vertical tic marks to bethe same style. The lines may take on the same characteristics as lines that we plot with the Ferret PLOT command: dashed orsolid; colors Black,Red,Green,Blue,LightBlue,Purple, and White (Ferret only)and THICK=1,2, or 3 where 1 is thin and 3 is the thickest.

yes? PLOT/GRAT=dash/i=1:40 sin(i/6)

We can give multiple arguments to the /GRATICULE qualifier within parentheses

yes? USE coads_climatologyyes? SET REGION/X=130E:70W/y=30S:50N/L=1yes? CONTOUR/COLOR=blue/GRAT=(line,COLOR=red) sstyes? GO land thick
yes? GO fland

 

Here is another example of a simple /GRAT qualifier

yes? USE etopo20 yes? SHADE/PAL=dark_land_sea/GRAT=(COLOR=green) rose

Now a time axis.

yes? PLOT/THICK=3/color=blue/GRAT=(COLOR=black,THICK=1) uwnd

 

If there are large and small tics on the plot, each may havegraticule lines with different characteristics. Recall that time axes and log axes automatically have small tic marks; you can control the tic marks on other axes using the commands listed under "axis, customizing" and "axis, PPLUS commands" in the Ferret Users Guide.

yes? ppl axnmtc,2,2
yes PLOT/THICK/COLOR=blue/GRAT="large=(line),small=(dash,color=lightblue)"/i=1:40 sin(i/6)

 

Sometimes we might want to make different settings for thehorizontal and vertical graticules; when the two axes representdifferent quantities, such as space and time, or very differentscales. The /HGRATICULE qualifier sets the horizontal graticulesand the /VGRATICULE qualifier sets the vertical graticules.

Here is a plot with a logarithmic axis

yes? DEFINE AXIS/Z/DEPTH dlog=exp(k[k=1:10])
yes? LET fcn = k[gz=dlog]
yes? PLOT/VLOG/VLIMITS=1:10000/HGRAT="LARGE(COLOR=red),SMALL(COLOR=lightblue)"/VGRAT fcn

 

And, a time axis, using only vertical graticulesm, but with small and large tics set differently..

 

yes? USE monthly_navy_winds
yes? PPL AXNMTC 2,2
yes? PLOT/VGRAT="LARGE(line,COLOR=blue),SMALL(dash,COLOR=lightblue)" uwnd[X=180,Y=0,T=1-may-1989:1-may-1992]

 

yes? PPL AXNMTC 2,1
yes? USE etopo05
yes? SET REGION/X=130E:160E/y=30S:0S
yes? SHADE/SET/HGRAT="LARGE=(THICK),SMALL"/VGRAT="LARGE=(THICK),SMALL"\
yes? /PALETTE=topo/LEV=(-9000,-1000,1000)(-1000,-100,100)(-100,0,10) rose
yes? PPL XAXIS 130,160,8
yes? PPL YAXIS -30,0,10
yes? PPL SHADE
yes? GO fland 5