
NCL > Application examples > Basic examples
Primitives example 3
How to draw primitives in NDC space and do clipping
This example shows how to set up a GraphicStyle object to draw primitives in NDC space and how to do clipping. This example demonstrates how to create the plot using HLU C library calls, HLU FORTRAN library calls, and NCL. The names of the example codes that create this plot are pr03c.c, pr03f.f, and pr03n.ncl.
Discussion
Resources are controlled through a resource file called pr03.res.A detailed discussion about how to create the plot appears in the comments of the source code for the example.
Creating the plot using HLU C library calls
The HLU C program that generates this plot is called pr03c.c.
Creating the plot using HLU FORTRAN library calls
The HLU FORTRAN program that generates this plot is called pr03f.f.
Creating the plot using NCL
The HLU NCL program that generates this plot is called pr03n.ncl.
The data
The data are generated from within the program or script.
How to run this example
There are three ways to produce this example: by using a C program (pr03c.c), a FORTRAN program (pr03f.f), or an NCL script (pr03n.ncl). The examples are installed in the following locations:
- $NCARG_ROOT/lib/ncarg/hluex/primitives/pr03c.c
- $NCARG_ROOT/lib/ncarg/hluex/primitives/pr03f.f
- $NCARG_ROOT/lib/ncarg/nclex/primitives/pr03n.ncl