
NCL > Application examples > Basic examples
XyPlot example 10
Overlaying an XyPlot on a MapPlot
This example can be created using HLU C library calls, HLU FORTRAN library calls, or NCL. This example demonstrates how to overlay an XyPlot on a MapPlot. The names of the source files for this example are xy10c.c, xy10f.f, and xy10n.ncl.

Discussion
This module discusses how to create this plot using HLU function
calls and NCL. A resource file is included with this example, and it is
called xy10.res. This file is
used to change the default resource settings for the plot.
This example plots station locations over maps of the United States and the world. Polymarkers are used to indicate the location of station data. A more detailed discussion of how this example works appears in the comments of the source code.
Creating the plot using HLUs
The HLU C program that generates this plot is called xy10c.c.
Creating the plot using HLU FORTRAN library calls
The HLU FORTRAN program that generates this plot is called xy10f.f.
Creating the plot using NCL
The NCL script that generates this plot is called xy10n.ncl.
The data
The data for this plot is read from a netCDF file called 95031800_sao.cdf. This data is installed in your NCAR Graphics data directory. The location of this directory can be obtained by typing "ncargpath data". This is a netCDF file, so you can use the netCDF utility, ncdump, to view the header information for this file. Type "ncdump -h 95031800_sao.cdf" to view the set of variables and attributes that are stored in this file.
How to run this example
You can produce this example by using a C program (xy10c.c), a FORTRAN program (xy10f.f), or an NCL script (xy10n.ncl). The examples are installed in the following locations:
- $NCARG_ROOT/lib/ncarg/hluex/xyplot/xy10c.c
- $NCARG_ROOT/lib/ncarg/hluex/xyplot/xy10f.f
- $NCARG_ROOT/lib/ncarg/nclex/xyplot/xy10n.ncl
- $NCARG_ROOT/lib/ncarg/resfiles/xyplot/xy10.res
- $NCARG_ROOT/lib/ncarg/data/cdf/95031800_sao.cdf