ContourPlot example 10
This example demonstrates how to use HLUs and NCL to read data from a
netCDF file and create a series of contour plots from the data. The
names of the example codes that create this plot are cn10c.c, cn10f.f,
and cn10n.ncl.
This module discusses how to create this plot using HLU function calls
and NCL. This module also shows how to read netCDF data from a file
and produce a series of contour plots. The example demonstrates how to
create a contour plot using mostly defaults, how to turn on contour
fill and other plot attributes, how to plot a sub-area, how to create
an XyPlot through the contoured area, and how to overlay the contour
plot on a MapPlot object. There is no resource file for this example,
as all the resources are set in the source code.
A detailed discussion of how this example works appears in its source
code.
The HLU C program that generates this plot is called cn10c.c.
The HLU FORTRAN program that generates this plot is called cn10f.f.
The NCL script that generates this plot is called
cn10n.ncl.
The data for this plot is from a netCDF file called cn10n.cdf.
The data file is located in your NCAR Graphics data directory in a
subdirectory called "cdf". You can get the name of the data directory
by typing "ncargpath data" at your shell prompt. If you have netCDF
installed on your system, then you can change directory to where the
netCDF file resides and type "ncdump -h cn10n.cdf" to view the
header information for this data file.
The examples are installed in the following locations:
- $NCARG_LIB/ncarg/hluex/contourplot/cn10c.c
- $NCARG_LIB/ncarg/hluex/contourplot/cn10f.f
- $NCARG_LIB/ncarg/nclex/contourplot/cn10n.ncl
The netCDF data file is installed in the following location:
- $NCARG_LIB/ncarg/data/cdf/cn10n.cdf
You can copy this example and run it by typing "ng4ex cn10c", "ng4ex
cn10f", or "ng4ex cn10n". A copy of the source file and resource file
will be placed in your current working directory. The source code
will be compiled and automatically run for you. You must have the netCDF library
installed on your system in order to compile the C or FORTRAN version
of this example.
You can view the output NCGM file using the NCAR Graphics ctrans utility.
(Type "ctrans cn10n.ncgm".)
Quick Start Guide Control Panel
NG4.1 Home, Index, Examples, Glossary, Feedback, QSG Contents, QSG WhereAmI?
$Revision: 1.10 $ $Date: 1999/03/23 18:34:15 $