There is no way we can demonstrate every nuance of NCL on this page.
You will also need to use the
Examples to truly learn NCL.
Default black and white plot.
the plot interface that creates a cylindrical equidistant plot.
cnLineLabelPlacementMode = "constant", is one of the
for controlling contour labels. the constant method is the only one in
which the label becames part of the line.
There are four title strings you can use to label a plot. The
automatically labeled with the long_name of the data, and
labeled with the units of the data. These can both be overwritten, or
turned off (by setting them to ""). There is also
and the plot title
Adds color and a local time axis.
cnFillOn = True, turns on a color plot.
a special resource that tells the plot template to use the full range of
There are many built-in
to choose from and many ways of specifying the
color of a plot.
axis.ncl contains all the
functions used to put local time axis on the HAO
master scripts. We have used one of
those functions here (set_lt_axis_ceplot). To use this function, you
need to load axis.ncl at the top of your script. Note that this function
Demonstrates the use of a
shea_util special contour effects function. There are numerous
contour effects to choose from.
ZeroNegDashLineContour draws negative contours as dashed
and the zero line as double thickness.
The NCL built-in functions
max allow you to take the min and max of the data.
Demonstrates manually setting contour intervals
cnLevelSelectionMode = "ManualLevels"
are the resources that manually sets the contour levels.
cnLineLabelsOn turns on the contour line labels, while
cnLineLabelBackgroundColor controls the color
behind the label. The gsn_csm templates set this to transparent by
default. You can not use this resource if you set
cnLineLabelPlacementMode to "constant".
Demonstrates plotting data on magnetic coordinates
The function mag2latlon (found in
hao_cobntrib.ncl takes data
on magnetic coordinates and changes the named dimensions fixes
the units of the coordinate variables so that the NCL gsn_csm plot
interfaces do not produce error messages.
It is necessary to turn off the cyclic point by setting
to False. The gsn templates automatically add a cyclic point, and
data on the magnetic coordinates already has one.
The local time axis for data on the magnetic grid is on the bottom
replacing the longitude axis.
Demonstrates overlaying an apex coordinate grid
This involves the creation of two overlays, one of the apex lat/lon
and the other of the combined apex lat/lon and the original plot.
Please see script for details.
A real world example of a customized plot. This example includes
the addition of vectors, explicit contours, and map zooming.
mpMaxLatF will zoom in the map.
Sometimes when only the latitude axis is limited, the labels shrink to
the point that they are unreadable. We can blow them up using
It may also be necessary to enlarge so the the general text with
To effectively view the variable in this example, it was necessary to
explicitly set the contour intervals. This is done with
cnLevelSelectionMode = "Explicit" and providing
This example draws vectors on top of scalars. For a complete description
of the vector resources used, and other vector options, please check out
CCSM vector page
Demonstrates a panel plot. There are too many nuances associated with
panelling. Please review the CCSM panel example page for details.
gsnZonalMean = True will turn on a side zonal mean
plot on cylindrical equidistant plots only.
Demonstrates interpolating the data to height before plotting.
the function "zplev_to_height" which we use to interpolate to height
master scripts. Note that this function
requires the create of a logical variable to which you attach the height
value. In the master scripts this variable is also used for other