
NCL > Application examples > Basic examples
XyPlot example 11
How to draw an XyPlot in an X Window and in an NCGM file
This example can be created using HLU C or HLU FORTRAN library calls or NCL. It demonstrates how to draw a plot in an X Window and then switch the output device to draw the plot to an NCGM file. The names of the source files for this example are xy11c.c, xy11f.f, and xy11n.ncl.

Discussion
This module discusses how to create this plot using HLU
library calls or NCL. A resource file is not used with this example. A detailed discussion of how this example works appears in its source code.
Creating the plot using HLU C library calls
The HLU C program that generates this plot is called xy11c.c.
Creating the plot using HLU FORTRAN library calls
The HLU FORTRAN program that generates this plot is xy11f.f.
Creating the plot using NCL
The NCL script that generates this plot is xy11n.ncl.
The data
The data for this plot is created by calls within the source program.
How to run this example
The examples are installed in the following locations:
- $NCARG_ROOT/lib/ncarg/hluex/xyplot/xy11c.c
- $NCARG_ROOT/lib/ncarg/hluex/xyplot/xy11f.f
- $NCARG_ROOT/lib/ncarg/nclex/xyplot/xy11n.ncl
You can copy this example and run it by typing "ng4ex xy11c", "ng4ex xy11f", or "ng4ex xy11n". A copy of the source file and resource file will be placed in your current working directory. The source code will be compiled (if necessary) and automatically run for you.