Basic example 4

How to draw to different output devices

This is an introductory example that shows how to select the output for an NCAR Graphics program. This example demonstrates how to draw the plot using NCL, HLU C, and HLU FORTRAN library calls in a X Window and in an NCGM file. The names of the example codes that create this plot are basic04n.ncl, basic04c.c, and basic04f.f.

Discussion

This module demonstrates how to specify the type of output for an NCAR Graphics program. This example shows how to draw the output to a named NCGM file and to an X Window. The example creates two "workstations" that specify the type of output that will be used. The example then draws a contour plot into each of the devices. The output to the X Window is dynamically displayed. The output to the NCGM file is stored in a file called ./basic04.ncgm and can be view by using the ctrans utility.

A detailed discussion about how to create the plots 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 basic04c.c.

Creating the plot using HLU FORTRAN library calls

The HLU FORTRAN program that generates this plot is called basic04f.f.

Creating the plot using NCL

The HLU NCL program that generates this plot is called basic04n.ncl.

The data

The data for this plot was generated internally in the NCL script and in the HLU source codes. The data is a 5x5 array of integer values.

How to run this example

This example can be generated using an NCL script (basic04n.ncl), a C program (basic04c.c), or a FORTRAN program (basic04f.f). The examples are installed in the following locations:

You can copy this example and run it by typing "ng4ex basic04n", "ng4ex basic04c", or "ng4ex basic04f". A copy of the source file will be placed in your current working directory. The source code will be compiled (if appropriate) and automatically run for you.


Quick Start Guide Control Panel

NG4.1 Home, Index, Examples, Glossary, Feedback, QSG Contents, QSG WhereAmI?


$Revision: 1.9 $ $Date: 1999/03/23 18:28:10 $