Skip to main content

Full text of "NASA Technical Reports Server (NTRS) 19890016226: Common Graphics Library (CGL). Volume 2: Low-level user's guide"

See other formats


NASA LANGLEY RESEARCH CENTER 


Central Scientific 
Computing Complex 
Document G-13 


Common Graphics Library (CGL) 
Volume II: Low-Level User's Guide 


Nancy L. Taylor 

Dana P. Hammond 
Pauline M. Theophilos 


April 1989 



Acknowledgements 


The following people have contributed significantly in the development, 
implementation, verification, and installation of the Common Graphics Library 
(CGL): David L. Miner, Alicia S. Hofler, Michelle S. Hollis, Scott Nolf, and Debbie 
M. Garrett. Also contributing in these regards are: Bradford D. Bingel, Eric L. 
Everton, Mary M. Johnson, Erma L. Wilson, and Helen O. Yue. 

We thank the following individuals for their careful reading and constructive 
comments: Connie Curran, Wesley L. Goodman, Christopher J. Harris, Mary K. 
McCaskill, and Eleanor C. Wynne. 


ii 



Common Graphics Library (CGL) 
Volume II: Low-Level Usei^s Guide 
April 1989 


LIST OF FIGURES 

HOW TO USE THIS DOCUMENT 

GLOSSARY 


1 . INTRODUCTION M 

1.1 Capabilities and Structure of the Common Graphics Library 1-1 

1.2 Common Graphics Library’s Prominence in the 

New Graphics System (NGS) 1 .4 

1.2.1 Underlying Graphics Package 1-4 

1.2.2 Device Drivers 1-6 

1.3 LaRC's Unique Plotting Requirements 1-7 

1 .4 Use of the CGL for Publication Purposes 1 -9 

1 .5 Planning Figures for Publication 1 -1 0 

2. BASIC CONCEPTS AND TERMINOLOGY 2-1 

2.1 Terms 'Chart' and 'Plot' 2-1 

2.2 Coordinate Systems 2-2 

2.3 Linear/Logarithmic Charts 2-5 

2.4 Bar Charts 2-8 

2.5 Pie Charts 2-10 

2.6 Composite Charts 2-12 


3 . LOW-LEVEL ROUTINES 

3.1 Introduction 

3.2 Underlying Graphics Package Characteristics used by 


the Low-Level Routines (using DI -3000 as an Example) 3-1 

3 . 2.1 Graphical Environment 3-3 

3 . 2.2 Coordinate Systems 3-4 

3 . 2.3 Page Coordinates and Describing Components 3-6 

3 . 2.4 Graphics Primitives and Attributes 3-8 

3.3 Steps in the Generation of Linear and Logarithmic Line Charts 3-1 1 

3 . 3.1 Plotting Linear Data 3-11 

3 . 3.2 Complete Program Plotting Multiple Linear Data Sets 3-14 

3 . 3.3 Adding a Key 3-16 

3 . 3.4 Complete Program Plotting Multiple Linear Data Sets 

with a Key 3.19 

3 . 3.5 Determining Publication Quality Axis Scale Factors 3-22 


3.3.6 Plotting Logarithmic Data 3-25 

3.3.7 Complete Program Plotting Multiple Logarithmic Data Sets 3-30 

3.3.8 Complete Program Plotting Multiple Semi-Logarithmic 

Data Sets 3-33 

3.3.9 Plotting Data with Grids without Keys 3-37 

3.3.10 Plotting Data with Grids and Keys 3-40 

3.3.1 1 Line Charts with Variations of Axes 3-43 

3.3.1 1.1 Plotting Data with a Decreasing Axis 3-44 

3.3.1 1 .2 Line Charts with Multiple Scales on an Axis 3-48 

3.3.1 1 .3 Line Charts with Interior Axes 3-56 

3.3.1 1 .4 Line Charts with Disjoint Axes 3-60 

3.4 Steps in the Generation of Bar Charts 3-63 

3.4.1 Page Coordinates and Describing Components 3-63 

3.4.2 Plotting Absolute Bar Chart Data 3-65 

3.4.3 Complete Program Plotting Multiple Absolute Bar Chart 

Data Sets 3-66 

3.4.4 Plotting Additive Bar Chart Data 3-69 

3.4.5 Complete Program Plotting Multiple Additive Bar Chart 

Data Sets 3-70 

3.4.6 Plotting Absolute and Additive Bar Chart Data 3-74 

3.4.7 Complete Program Plotting Multiple Absolute and 

Additive Bar Chart Data Sets 3-76 

3.4.8 Adding a Key to Bar Charts 3-80 

3.4.9 Complete Bar Chart Program with a Key 3-83 

3.5 Steps in the Generation of Pie Charts 3-87 

3.5.1 Page Coordinates and Describing Components 3-87 

3.5.2 Plotting Data for Pie Charts 3-91 

3.5.3 Complete Program Plotting a Pie Chart 3-94 

3.5.4 Steps in Plotting a Pie Chart with a Key 3-98 

3.5.5 Complete Program Plotting a Pie Chart with a Key 3-101 

3.5.6 Plotting a Pie Chart with Exploded Segments 3-105 

3.6 Steps in the Generation of Composite Charts 3-109 

3.6.1 Arranging Composite Charts 3-109 

3.6.2 Complete Program Plotting a Composite Chart 3-110 

4. ADDITIONAL CAPABILITIES 4-1 

4.1 Error Detection and Debugging Capabilities 4-1 

4.1.1 Error Detection 4-1 

4.1.2 Debugging Capabilities 4-5 

4.1.3 Destination of Output 4-9 


IV 



5. INTERFACING WITH OTHER GRAPHICS PACKAGES 5-1 

5.1 Requirements for Interfacing with the CGL 5-1 

5.2 Interfacing with a Generalized High-Level Graphics Package 5-2 

5.3 Interfacing with the CGL LEZ Routines 5-4 

6. POSTPROCESSING CONSIDERATIONS 6-1 

6.1 Postprocessors 6-1 

6.2 DI-3000 Concepts as Related to Static Plotters 6-2 

6.3 Distortion and Scaling 6-2 

6.4 Visual Characteristics 6-3 

APPENDICES 

A. Description of the Low-Level Routines A-1 

B. Test Cases and Charts of the Low-Level Routines B-1 

C. List of DI-3000 Routines C-1 

D. How to Access and Execute the Common Graphics Library D-1 


LIST OF REFERENCES 


v 



List of Figures 


Figure 1-1 

Three basic chart types. 

1-1 

Figure 1-2 

Structure of the Common Graphics Library from 



an application viewpoint. 

1-3 

Figure 1-3 

NGS hierarchy structure. 

1-5 

Figure 1-4 

NASA standard line patterns. 

1-7 

Figure 1-5 

NASA standard symbols. 

1-8 

Figure 1-6 

NASA standard symbols with flags. 

1-8 

Figure 1-7 

NASA standard symbols - solid filled. 

1-8 

Figure 1-8 

NASA logo. 

1-8 

Figure 1-9 

Vertical figure orientation. 

1-11 

Figure 1-10 

Horizontal figure orientation. 

1-12 

Figure 2-1 

Page coordinates. 

2-2 

Figure 2-2 

Data coordinates. 

2-3 

Figure 2-3 

Linear/logarithmic chart components. 

2-7 

Figure 2-4 

Bar chart components. 

2-9 

Figure 2-5 

Pie chart components. 

2-11 

Figure 2-6 

Example of a composite chart. 

2-12 

Figure 3-1 

DI-3000 basic skeleton program. 

3-2 

Figure 3-2 

DI-3000 skeleton program. 

3-4 

Figure 3-3 

Example of the use of a coordinate system. 

3-5 

Figure 3-4 

Example of outputting a set of linear axes. 

3-7 

Figure 3-5 

Example of the use of graphics primitives and attributes. 3-8 

Figure 3-6 

Setting and resetting CGL attributes. 

3-9 

Figure 3-7 

Example of plotting data in a linear chart. 

3-13 

Figure 3-8 

Complete XY line chart (with program). 

3-15 

Figure 3-9 

Complete XY line chart with a key. 

3-21 

Figure 3-10 

Example of axis generation with CSCALE. 

3-23 

Figure 3-1 1 

Example of a set of logarithmic axes. 

3-25 

Figure 3-12 

Example of plotting logarithmic data. 

3-29 

Figure 3-13 

Complete logarithmic chart with multiple data sets. 

3-32 

Figure 3-14 

Complete semi-logarithmic chart. 

3-35 

Figure 3-15 

Linear grid generated with CGRID. 

3-39 

Figure 3-16 

Sample grids with keys. 

3-41 

Figure 3-17 

Examples of non-standard axes. 

3-43 

Figure 3-18 

Example of decreasing axes. 

3-44 

Figure 3-19 

Complete program with a decreasing axis. 

3-47 


VI 



I 

I 


List of Figures (continued) 



Figure 3-20 

Example of multiple vertical scales on the same axis. 

3-51 


Figure 3-21 

Example of multiple vertical scales on the opposite axis. 3-55 


Figure 3-22 

Complete program with interior axes. 

3-59 

* 

Figure 3-23 

Complete program with disjoint axes. 

3-62 


Figure 3-24 

Horizontal character axis with rotated tick mark labels. 

3-64 


Figure 3-25 

Bar chart with multiple absolute data sets. 

3-68 

•m 

Figure 3-26 

Complete additive bar chart. 

3-73 


Figure 3-27 

Partial program with absolute and additive data sets. 

3-75 


Figure 3-28 

Complete program with absolute and additive 
data sets. 

3-79 


Figure 3-29 

Complete bar chart with a key. 

3-86 


Figure 3-30 

Example of page layout for a pie chart. 

3-89 


Figure 3-31 

Variables associated with pie chart generation. 

3-91 


Figure 3-32 

Plotting pie data. 

3-93 


Figure 3-33 

Complete pie chart program. 

3-97 


Figure 3-34 

Pie chart with a key. 

3-104 


Figure 3-35 

Pie chart with exploded segments. 

3-108 


Figure 3-36 

Example of a composite chart. 

3-113 


Figure 4-1 

Low-Level error detection mechanism. 

4-3 


Figure 4-2 

Low-Level debug capability. 

4-8 


Figure 5-1 

DI-3000 skeleton program. 

5-3 


Figure 5-2 

LEZ skeleton program. 

5-4 


Figure 5-3 

Interfacing the Low-Level routines with a high-level 
package. 

5-7 

•9 

Figure 5-4 

Interfacing the Low-Level routines with a high-level 
package. 

5-11 


vii 


How To Use This Document 


Volume II documents the use of the Common Graphics Library’s (CGL) Low-Level 
routines. This manual is intended to serve both as a user's guide and reference 
manual. 

Section 1 provides an introduction to the CGL by describing its purpose and 
capabilities. This section acquaints the user with an overview of the New 
Graphics System (NGS) and reveals the significance of the Common Graphics 
Library. 

Section 2 consists of basic terms and definitions which are used throughout the 
remainder of the document. 

Section 3 consists of a detailed description of how to use the Low-Level routines. 
This section is primarily intended to provide a basic understanding of the 
necessary attributes, primitives, graphic components, coordinate systems, and 
graphical environment necessary to use the Low-Level routines. 

Section 4 gives an overview of the error detection and debugging capabilities 
available in the Low-Level routines. 

Section 5 describes how to interface the CGL Low-Level routines with other 
graphics packages. This section will discuss the requirements necessary to 
interface the Low-Level routines with any graphics package, then use the LEZ 
routines as a specific example. 

Section 6 gives a general overview of postprocessing considerations. 

Appendix A supplies a complete description of each Low-Level routine, providing 
a description of the arguments, the routine’s restrictions, and any relevant notes. 

Appendix B is a collection of commented test cases accompanied with the 
corresponding graphics output. The examples in this section are intended to 
reflect some of the typical charts generally desired by various groups at Langley. 

Appendix C provides a list of DI-3000 routines. Although the user must know 
DI-3000 to use the Low-Level routines, this list is included for completeness, and 
provides the functionality of the DI-3000 calls. 

Appendix D shows the user how to access and execute the CGL on various 
computers. 

viii 



Glossary 


ACD 

attribute 

bar chart 

CDC 

character axis 
chart 

Common Library 

composite chart 
CORE 

data coordinates 
defaults 


Analysis and Computation Division 

An inherent characteristic generally used in describing an 
external appearance of an entity (e.g., color, height, etc.) 

A chart consisting of rectangles with heights representing a 
dependent value at an associated independent position. 

Control Data Corporation 

An axis which has evenly spaced tick marks with text tick 
mark labels. 

A graphical representation giving information in tabular form. 
Plots which are "bars" are referred to as "bar charts", while 
plots which use "pie segments" are referred to as "pie charts". 

A subroutine library which satisfies LaRC local requirements 
and generates features not supported by other graphics 
libraries. 

A collection of two or more charts on a single display area 
(terminal screen, graphics frame, etc.). 

A proposed graphics standard developed by the Association 
of Computing Machinery’s Special Interest Group on 
Graphics (SIGGRAPH). 

A user-defined set of coordinates in which the data is to be 
plotted. This term is used interchangeably with data space . 
See section 2 for a description and example. 

A set of initial values for a set of attributes. 


ix 



device driver 
device 

independence 
frame 
frame eject 

FSGB 

GKS 

graphics session 

High-Level 

routines 

interval units 

ISO 

kernel 

key 

LaRC 

LARCGOS 


A device-dependent program that supports a specific 
graphics device. The device driver generates device- 
dependent output from device-independent input and 
handles device-dependent interaction. 

The ability to control all graphics devices uniformly. 


A complete unit of plotting. A final figure. A page. 

A frame eject clears the display area of the selected graphics 
device in preparation for the next frame of picture(s). 

Flight Software and Graphics Branch of ACD 

Graphics Kernel System - a graphics standard approved by 
ISO. 

time in which interaction with, or use of a graphics package 
takes place. 

A set of routines providing an interface to generate specific 
chart types. 

The increment between numeric major tick labels. 

International Standards Organization 

A subroutine library which contains all required functions for 
performing interactive and passive graphics tasks. 

A list of words or phrases giving an explanation of symbols or 
abbreviations. 

Langley Research Center 

A library of locally written graphics subroutines and a set of 
postprocessors that drive the ACD Production Devices. 
LARCGOS is part of the Old Graphics System (OGS). 


x 



line graph 

A graph in which points represent values of a variable for 
suitable values of an independent variable and are 
connected by line segments. Line graphs available in the 
Common Graphics Library include linear charts (those with 
linear axes) and logarithmic charts (those with logarithmic 
axes). 

linear axis 

An axis which has a linear progression of numeric major tick 
mark labels. 

linear chart 

A chart in which both axes are linear (see section 2 for a 
description and an example). 

logarithmic axis 

An axis which has a logarithmic progression of numeric major 
tick mark labels. 

logarithmic chart 

A chart in which both axes are logarithmic (see section 2 for a 
description and an example). 

Low-Level 

routines 

A set of routines in the Common Graphics Library which 
provide graphical support in the generation of plots unique to 
the graphics requirements of LaRC. 

metafile 

A sequential file which contains the device-independent 
picture information necessary to produce the desired 
graphical output. 

metafile 

translator 

The program which interprets the device-independent 
metafile commands for specific physical devices 

MOVIE.BVU 

A graphics display system written at Brigham Young 
University. 

NASA line 
patterns 

A set of LaRC preferred line patterns used to represent data 
in line charts. 

NASA Logo 

An emblem officially recognized by NASA. 

NASA symbols 

A set of LaRC preferred symbols used to represent data in 
line graphs. 


xi 


NCAR 


A library of graphics subroutines written at the National 
Center for Atmospheric Research. 

New Graphics System at LaRC 


NGS 

NOS 

OCO 

OGS 

page coordinates 

passive graphics 
PC 

pie chart 

pie segment 
postprocessor 

PRIMOS 

production 

devices 

publication 

standards 

PVI 

scale factor 


Network Operating System running on Control Data 
computers. 

Operations Control Office in Building 1268 at LaRC 
Old Graphics System at LaRC 

A user-defined set of coordinates in which all charts and their 
components can be described. 

Graphics requiring no dynamic interaction with the display. 

Personal computer (e.g., IBM PC XT) 

A diagram consisting of a circle which is divided by radii, 
called pie segments, each of which represent a part of a 
whole entity. 

Section of a circle consisting of an area swept out by a 
radius. 

A device-dependent program that drives an ACD production 
device. 

PRIME Operating System 

Batch graphics output facilities at the Central site; includes 
Calcomp, Varian, and Versatec. 

A set of requirements describing the appearance and 
contents of plots which must be satisfied for use in technical 
documents published through the NASA publication process. 

Precision Visuals, Inc. of Boulder, Colorado 

The change in value per scale increment (between major tick 
marks). 


xii 



I 


scale origin 

The beginning lower scale value. This is usually the 
minimum value or an adjusted minimum value. 

selected graphics 
device 

A graphics device which is enabled to receive graphics 
output or to send graphics input. 

semi-log chart 

A chart with one linear and one logarithmic axis. 

tick mark 

Short lines at specified intervals denoting grid. 

viewgraph 

standards 

A set of requirements describing the appearance and 
contents of plots which must be satisfied for use in audience 
presentations. 

workstation 

An abstract logical unit consisting of zero or one display 
surface and zero or more input devices. 

2D 

Two-dimensional 

3D 

Three-dimensional 


xiii 


1. INTRODUCTION 


The Common Graphics Library (CGL) is a simple-to-use, yet powerful graphics 
package which enables the user to view data quickly and easily, provides a means 
of generating publication and/or viewgraph quality charts, and satisfies LaRC's 
unique graphics requirements. 

The use of the Low-Level routines of the CGL, documented in this manual, requires 
a working knowledge of the DI-3000 graphics package. In developing a graphics 
program, the Low-Level routines work in conjunction with the DI-3000 routines. 
The LEZ routines of the CGL should be examined to determine if the user's 
application can be accomplished at the highest level (i.e. , LEZ routines). 

The graphics requirements at LaRC are very diverse in nature, reflecting the variety 
of applications (i.e., scientific, engineering, business, etc.) present at NASA 
Langley. The CGL and this manual concentrate on 2D chart generation. The three 
basic chart types generated by the CGL include: line/logarithmic charts, bar charts, 
and pie charts (see Figure 1-1). A few of the library's most sought after features 
include: 

- multiple plots per frame; 

- multiple data sets per plot; 

- the ability to access multiple fonts (i.e., Greek, math symbols, etc.) and 
text mnemonics (i.e., subscripts, superscripts, etc.); 

- color capability; 

- the creation of metafiles (for hard copy postprocessing); and 

- the ability to automatically scale and determine increments for axes 
suitable for publication quality reports. 

1.1 Capabilities and Structure of the Common Graphics Library 

The CGL has two user interface levels, a set of generalized High-Level (Langley 
Easy, or LEZ) routines [G-12], and a set of specific Low-Level routines [G-13] (see 
Figure 1-2). These two levels reflect the degree of sophistication both in terms of 
difficulty of use and provided capabilities. 

The LEZ routines , intended for users with no graphics experience , provide a 
stand-alone means to generate complete report-quality charts. At this level, the 
user controls aspects of an entire chart, that is conceptually designs and composes 
complete charts without being involved in the complexity of the underlying graphics 
package. While this level of separation frees the user from learning the underlying 
graphics package, it also ensures that the application program will require no or 
little change even if the underlying graphics package is modified or replaced (i.e., 
possibly by a graphics standard like the Graphics Kernel System - GKS). 


1-1 


Alloy 2 
15.5% 


Alloy 3 
12 . 2 % 


Nickel 

21.4% 



Alloy 1 
19.3% 


Others 

13.4% 


c ?S p i% 

a) Composition of Superalloy 


Pressure 
at failure, 
pascals 






O 

Temperature, C 

b) Low pressure fatigue of Superalloy 



Entropy, S, J/mol at 1 atmos 
c) Temperature vs. entropy for Superalloy 


Figure num. Characteristic charts for Superalloy 

Figure 1-1. Three basic chart types. 

Pie chart (top); bar chart (middle); line chart (bottom). 


1-2 


The Low-Level routines , which require the user to have an applied knowledge of 
DI-3000. allow the user to manipulate chart components, and thereby design 
specific report-quality charts for unique or unusual purposes. The features at this 
level can be used alone with the base graphics package, or in conjunction with 
other packages (e.g., LEZ, etc.) to enhance or augment their capabilities. Since the 
user is constructing a chart from components, the user has a greater range in the 
diversity of charts to be generated. However, this diversity is offset by a greater 
programming effort. It is recommended that the LEZ routines be examined first to 
determine if the user's application can be accomplished at the highest level 
possible. 

The capabilities of both levels are presented as an application-independent 
graphics package written in ANSI FORTRAN 77, and currently uses DI-3000 as its 
underlying graphics package. The library is therefore machine-independent, 
providing support for centralized and/or distributed computer systems. 


User application program 


COMMON GFtAPHICS LIBRARY 


Langley Easy (LEZ) Plot 
Routines 


The Low Level 
Routines 


The underlying 
graphics package 


Figure 1-2. Structure of the Common Graphics Library from an application 

viewpoint. 


1-3 




1.2 Common Graphics Library’s Prominence in the New Graphics System (NGSt 


The Common Graphics Library is a FORTRAN user-callable library which can be 
used independently or in conjunction with other graphics packages. This 
subsection is intended to briefly describe how the Common Graphics Library is 
related to NGS. The Graphics MINI Manual [G-1] identifies and describes the 
various graphics software and hardware components, details the interfaces 
between these components, and provides information concerning the use of 
these components at LaRC. Figure 1-3, the NGS hierarchy structure, shows the 
major graphics software packages and hardware devices currently supported. 

As previously described, the Low-Level routines of the Common Graphics Library 
interface with the underlying graphics package directly. The level of 
sophistication of the Low-Level routines enable the software packages which are 
functionally higher in the hierarchy to utilize these capabilities. To interface the 
CGL with other graphics packages, the user must either directly modify the 
package calling the CGL or use the CGL in conjunction with the calling package 
adhering to the constraints of both packages. 

1.2.1 Underlying Graphics Package 

Currently, DI-3000 is the application independent, underlying graphics package 
serving as a primary component of the CGL. The LEZ routines provide an 
abstract interface which is "commercial graphics package independent". This 
implies that the calling sequence and arguments supplied to the LEZ routines do 
not rely on a specific underlying graphics package. This independence is 
conducive to future transitions of the LEZ routines from DI-3000 to another 
underlying graphics package (e.g., GKS). 

The Low-Level routines interface with DI-3000 directly, and are therefore "context 
sensitive" (i.e. , must conform to the requirements of "where" and "how" the 
graphical components can be created and generated). Additionally, the 
capabilities of the Low-Level routines depend heavily upon the primitives and 
attributes present in the underlying graphics packages (e.g., color, character, 
fonts, interim line patterns, etc.). 


1-4 



use* DEVELOPED 


MENU/COMMAND 

DRIVEN 

INTERFACES 


□ □ □ CD 


CD 


j MOVIC.gYU j r 


APPLICATION 

DEPENDENT 

LIBRARIES 


COMMON LIBRARY 
LEZ routines 


CRAFVAKER 


x 


COMMON UBRARV 
t qw-lgvel routines 


| CONTOUR | | NCAR | 


| OTHER } 


PEVICE/HOST 

INDEPENDENCE 


DI-3000 

(KERNEL) 


DEVICE/MOST 
DEPENDENCE 
(DEVICE DRIVER) 


i r 


i i 1 — i 1 


METAFILE 

WORKSTATION 

'TERMINAL 

HARDCOPY 

FILM PRINTER 

OTHER 



VECTOR 

RASTER 

B/W 

COLOR 

PLOTTER 

RECORDER 



Figure 1-3. NGS hierarchy structure. 


1-5 








1.2.2 Device Drivers 


The following is an overview of the NGS device drivers, and how the CGL 
interfaces with them. The user is referred to the Graphics Mini Manual [G-1] for a 
more detailed description of the device drivers. 

Each of the NGS software components interface to a hardware device through a 
device driver. A DI-3000 device driver is a collection of device specific 
subroutines that drive a particular display device. A separate DI-3000 device 
driver is associated with each graphics output device. A special device driver, the 
metafile driver, produces a file of device independent graphics information that 
may be processed by the METAFILE TRANSLATOR [G-6]. The features of each 
device driver are documented in the Device Driver Guide [G-10]. Although the 
device driver is linked at load-time, the user must initialize, select, and perform 
other device action from within the application program. Each device is assigned 
as an integer number. For load-time device selection, the metafile driver is 
assigned "0" and any other device is assigned "1". 

Since the LEZ routines are not restricted to a specific general purpose graphics 
package, but provides an abstract interface, the following call selects and 
initializes the identified device(s): 

CALL LEZ INI (IDEV) 

where IDEV is the assigned device name (0 - metafile, 1 - Interactive device, 2 - 
both metafile and interactive device). Note, this routine can be called again to 
select and deselect specific devices. A complete description of selecting and 
initializing the underlying graphics package from the LEZ routines can be found 
in Appendix A [G-1 2] in the description of LEZINI. 

When the Low-Level routines are used solely in conjunction with the underlying 
graphics package, then the underlying graphics package will provide the means 
by which the device drivers are initialized and selected. In the case of the 
Low-Level routines of the CGL, and the underlying graphics package DI-3000, 
the device driver must be selected and initialized with the following DI-3000 calls 

CALL JDINIT (IDEV) 

CALL JDEVON (IDEV) 

where IDEV is the assigned device number (0 - metafile, 1 - interactive device). A 
complete description of selecting and initializing DI-3000 can be found in the 
DI-3000 User's Guide [G-5], 


1-6 



1.3 LaRC’s Unique Plotting Requirements 


The graphics requirements at LaRC are very diverse in nature, reflecting the 
variety of applications (business, CAD/CAM, engineering, and scientific, etc.) 
present at NASA Langley. The CGL and this manual concentrate on 2D chart 
generation. These types of charts include: line/logarithmic charts, bar charts, and 
pie charts. See Section 2 for a description of each chart type. 

Unlike a commercially developed general purpose graphics package which is 
typically designed for the graphics user community at large, the CGL is tailored 
toward a specific set of restrictions proposed by LaRC. This set of requirements 
necessitated the development of a Langley specific graphics library, the Common 
Graphics Library. One of the chief considerations in the design of the CGL was 
the capability of generating publication quality charts requiring a minimal of effort. 

The format of computer-generated charts must conform to various criteria 
depending on where and how the charts are to be used. Several types of 
journals and technical papers require that the charts are acceptable to the 
Langley publication process. The remainder of this subsection will provide only 
the basic characteristics of this criteria, whereas a complete description can be 
found in "Guidelines in Preparing Computer-Generated Plots for NASA Technical 
Reports with the LaRC Graphics Output System" [G-2]. 

A fundamental intent of the CGL is to provide a set of primitive routines unique to 
LaRC. These requirements partially consist of: the NASA line patterns, the NASA 
symbols, and the NASA logo. 

The NASA line patterns consist of the following eight line patterns in the following 
sequence: 


1 

2 

3 

4 

5 

6 

7 

8 


Figure 1-4. NASA standard line patterns. 


1-7 



The NASA symbols consist of the following symbols in the following sequence: 


1 

o 

2 

□ 

3 

o 

4 

A 

5 


6 


7 

Q 

8 

o 

9 

0 

1 O 

A 

1 1 

© 

1 2 

a 

13 

❖ 

^ 4 

A 

1 5 


1 6 

& 

1 7 

© 

i a 

<5> 

1 9 

❖ 

20 



Figure 1 -5. NASA standard symbols. 


If a flag is desired, add 100, 200, 300, .... 800 to the base symbol number. Note, 
symbols one through ten are recommended for publication quality plots. 


1 O 101 Cf 201 'O 301 jO 401 Q 

501 Cf 601 fc) 701 aoi 

Figure 1-6. NASA standard symbols with flags. 

If a solid filled symbol is desired, add 900 to the base symbol number. Note, 
however, the use of solid filled symbols is not desirable for publication quality 
charts. 


901 Q 

Figure 1-7. NASA standard symbols - solid filled. 

The NASA logo is an emblem officially recognized by NASA. The policy 
governing the use of the NASA logo is documented in the NASA Management 
Manual (NMI 1020.1G Paragraph 13b). 

NASA 

Figure 1-8. NASA logo. 


1-8 



1.4 Use of the CGL for Publication Purposes 


In addition to these primitives, the page layout and the contents of the charts must 
conform to the criteria determined by the chart's intended audience. For 
example, the sizes and distances between various chart elements must be 
sufficient to provide a clear and legible chart. 

The intent of the publication quality standard is to ensure that charts will 
consistently be published legibly with no loss of integrity. As such, a set of 
publication parameters are defined that control the size of the characters used for 
labeling, the distances to the labels, the distances between lines and columns, 
the length of tick marks, and the symbol sizes. Whereas, the use of viewaraph 
standards ensures that charts being presented to a group will show the data 
clearly and legibly. 

The Common Graphics Library provides a method to obtain publication and 
viewgraph quality charts. By default, the CGL will conform to publication quality 
standards by providing: 

- appropriate sizes and distances between various chart components: 

- data curves using lines and symbols, such that the line does not pass 
through the symbols; 

- text attributes suitable to acceptable publication standards; and 

- appropriate distancing between tick mark labels and the axes. 

Because the CGL defaults to the use of these NASA standards, the user is 
required to have a minimum knowledge of the actual specifications needed to 
obtain these charts. However, the user is responsible for using the library in such 
a way as to stay within the criteria of the publication process. The user should 
ensure that: 

- user defined text heights and widths are acceptable; 

- appropriate capitalization of text conforms to standards; 

- numeric tick mark labels have suitable scale factors; 

- text does not overwrite other components (and/or text); and 

- content is appropriate for the audience's clarity. 


1-9 



1.5 Planning Figures for Publication 


It is a common practice that most of the figures in NASA reports are grouped 
together at the end of the report instead of inserted in the text; therefore, all 
figures should be as uniform as possible. However, authors are instructed to 
discuss requirements with the editors if they want figures integrated in the text. 
The basic rules to follow in planning uniform figures are: 

1. The chart perspective should be read from one point; the person 
reading the charts should not have to rotate the paper to read the charts. 
The one exception to this rule is a long vertical label. 

2. The plot areas should be kept the same size and the charts should be 
oriented the same throughout the report. 

3. The same scale per unit value (scale increment) should be used on 
similar data, even if the data are in different ranges. For example, a 
scale increment, for an angle should remain the same even if the range 
is 0 to 90 for one chart and 90 to 180 for another chart. 

4. The vertical figure orientation (see Figure 9) is preferred. The vertical 
measurement is 9 3/16 inches (233.4 mm.) and the horizontal 
measurement is 7 1/8 inches (181.0 mm.). 

5. The horizontal figure orientation (see Figure 10) is not preferred 
because the report must be physically rotated to view the figure, but 
there are times when the data necessitates using the horizontal figure. 
The horizontal measurement is 9 3/16 inches (233.4 mm.) and the 
vertical measurement is 7 1/8 inches (181.0 mm.). 

6. All labeling within the plot area should be the same size even if the 
figure is divided into multiple parts. If a figure is divided into multiple 
parts, the height of the full-size character for labeling is based on the 
size of the whole figure, not each separate part. 

7. Horizontal axis should represent independent data, vertical axis should 
represent dependent data. 

8. Character heights should be 1/4 greater than widths (or conversely 
width should be 0.8 of height). 


1-10 







i 

i 

i 

i 

- 


i 

i 

i 

i 

i 

i 



i 

i 

PLOT AREA | 

i 

i 

1 

i 

i 

i 

image area | 
1 


VERTICAL FIGURE 

i 

i 

i 

1 

1 

1 

- 


i 

i 

1 

1 

* 

A 

LEGEND AREA ^ 

i_ 


1 

1 

i 


Figure 1-9. Vertical figure orientation. 


1-11 





Figure 1-10. Horizontal figure orientation. 


1-12 


LEGEND AREA 


2. BASIC CONCEPTS AND TERMINOLOGY 


This section provides an overview of the various types of charts and identifies 
and illustrates their various components. This section is intended as a 
reference only. Conceptually, this section begins with the more abstract 
concepts and breaks them into smaller, more refined elements. 

2.1 Terms ’Chart' and ’Plot* 

The terms chart and plot are often used interchangeably, but have subtle 
differences depending on the context in which they are used. 

chart - a diagram (a series of one or more symbols, lines, line segments, 
curves, tabular data, or areas) that represents the variation of a variable in 
comparison with that of one or more other variables. Charts which depict linear 
data are referred to as "line charts" or "linear charts". Charts which depict 
logarithmic data are referred to as "log charts" or "logarithmic charts". Charts 
which use "bars" are referred to as "bar charts", while plots which use "pie 
segments" are referred to as "pie charts". There are three basic chart types: 
linear/logarithmic charts, bar charts, and pie charts (see Figure 1-1). Each type 
is explained in a following subsection, and concepts specific to each are 
detailed. 

plot - one or more charts on a single display area (terminal screen, graphics 
frame, etc.). Thus, "plot" is used interchangeably in this document as a generic 
term for "chart". 

composite chart - a collection of two or more charts on a single display area 
(terminal screen, graphics frame, etc.). 


2-1 


2.2 Coordinate Systems 

A fundamental approach in chart generation using the CGL routines is to 
conceptually distinguish between entities framing the data (e.g., axes, text, etc.), 
and the data itself. To facilitate chart generation, two independent windows are 
typically established, and are referred to as page coordinates and data 
coordinates. 


page coordinates - The CGL routines allow the user to define a coordinate 
system in which to describe all charts and their components . This system 
provides a unit of measure allowing the user to establish lengths and distances 
(e.g., axis length, axis positioning, etc.). This coordinate system is referred to as 
page coordinates (or page space). The units used to describe the page 
boundaries can be determined by the user, and can represent any unit of 
measure the user wishes. If the user is going to send the charts to a 
postprocessing device, a compatible unit of measure is desirable (e.g., inches 
or millimeters). 








data coordinates (or data space) - The CGL routines allow the user to 
define a coordinate system in which the data is to be plotted . The user controls 
the range and values of the data coordinate system through calls to the 
appropriate routines. The data coordinates only affect how and where the data 
is to be plotted on the page. If data to be plotted lies outside the data space, 
then those data values may optionally be clipped (i.e., not plotted). The 
location of the data coordinate system is typically determined by the boundaries 
formed by a set of axes (two or more). 



Independent data on the x — axis 


Plot of y= | 100cosl8x | 

Figure 2-2. Data coordinates. 


2-3 



2.3 Linear/Logarithmic Charts 


A linear/logarithmic chart is a diagram which uses a series of one or more 
symbols, lines, line segments, and/or a combination of these to represent data. 
For a linear chart, the scale factor (i.e., the change in values between major tick 
marks) progresses in a linear fashion. For a logarithmic chart, the scale factor 
progresses in a logarithmic fashion. 

Charts are further classified based on the scale factors for the dependent and 
independent axes: 

linear chart - both axes are linear 

logarithmic chart - both axes are logarithmic 

semi-log chart - one axis is linear and logarithmic. 

The CGL line plotting routines will generate publication and/or viewgraph line 
charts with the NASA line patterns and symbols. When a data curve is 
represented with both lines and symbols, the CGL routines will display the data 
with the line not passing through the symbol. The user may plot linear, 
logarithmic, or semi-log charts. The CGL line routines offer the capability of 
generating a "key", which provides additional information about the data in the 
chart. By the use of unique line patterns and symbols, it is possible to plot a 
family of curves which can clearly be seen either on a color viewgraph, or on a 
black and white printed report. 


PRECEDING PAGE BLANK NOT FILMED 


2-5 



1) horizontal axis - 

the axis parallel to the bottom of the figure orientation when viewing the 
page from the intended perspective. The horizontal axis usually 
represents the independent data. 

2 ) vertical axis - 

the axis parallel to the side of the figure orientation when viewing the 
page from the intended perspective. The vertical axis usually represents 
the dependent data. 

3) major tick mark - 

short lines at specified intervals perpendicular to the axis being denoted. 

4) major tick mark labels - 

a character or numeric description associated with a major tick mark. 
Often referred to as "tick mark labels". 

5 ) minor tick marks - 

short lines (preferably shorter than major tick marks) between major 
tick marks perpendicular to the axis being denoted. 

6) scaJsiactar • 

the change in value between numeric major tick marks. 

7) ax i s la bel • 

a text string describing the properties associated with an axis. 

8) ksy- 

a block of information placed within the page boundaries, explaining any 
codes or symbols used on the chart. 

91 kev entry - 

a line consisting of a description associated with a symbol and/or line. 

10) caption - 

the figure number and title. Often referred to as a chart title . 


2-6 



Aerodynamic properties 


The following figure illustrates the various components of linear/logarithmic 
charts. 


o 



Figure 2-3. Linear/logarithmic chart components. 


2-7 


2.4 Bar Charts 


A bar chart is a diagram which uses a series of rectangles. The height of each 
rectangle represents a dependent value at an associated independent position. 

The charts may be represented in an absolute manner (side by side) 
contrasting the data distinctly. The charts may be represented in an additive 
manner (stacked) showing their cumulative properties. A key option can be 
used to provide additional information concerning multiple data sets. 

1) horizontal axis - 

the axis parallel to the bottom of the figure orientation when 
viewing the page from the intended perspective. The horizontal axis 
usually represents the independent data. 

2) vertical axis - 

the axis parallel to the side of the figure orientation when viewing the 
page from the intended perspective. The vertical axis usually represents 
the dependent data. 

3) major tick mark - 

short lines (preferably shorter than major tick marks) between major 
tick marks perpendicular to the axis being denoted. 

4) major tick mark labels - 

a character or numeric description associated with a major tick mark. 
Often referred to as "tick mark labels". 

5^ minor tick marks - 

short lines between major tick marks perpendicular to the axis being 
denoted. 

6^ scale factor - 

the change in value between numeric major tick marks. 

7) axis label - 

a text string describing the properties associated with an axis. 

8) kev - 

a block of information placed within the page boundaries, explaining any 
codes or symbols used on the chart. 


2-8 



Pressure at failure, psi 




Low pressure fatigue testing 

Figure 2-4. Bar chart components. 



2-9 


2.5 Pie Charts 


A pie chart is a diagram consisting of a circle which is divided by radii, called 
pie segments, each of which represent a part of a whole entity. The following 
figure illustrates the various components of a pie chart. Pies are most often 
used in showing the "percent of" or "composition of" a particular item. 

The LEZ routines generates complete pie charts. Although there are no 
Low-Level pie routines, this type of chart is presented in the Low-Level 
document because it is often requested, and can easily be generated from the 
underlying graphics package and the Low-Level routines. 

1) radius- 

the length of a line segment extending from the center of a pie segment 
to the pie segment circumference. 

2) origin - 

the center of the pie. 

3) pjg seg me n t - 

a wedge-shaped polygon representing a percentage of the entire pie. 

4) pie segment text label - 

a description associated with a pie segment. 

5) pie segment quantity label - 

the actual value of which the segment represents. 

6) pie segment percentage label - 

the percentage of the pie which the segment denotes. 

7) key - 

a block of information placed within the page boundaries, explaining any 
codes or symbols used on the chart. 

81 kev entry - 

a line consisting of a description associated with a symbol and/or line. 

9) caption - 

the figure number and title. Often referred to as a chart title . 


2-1 0 






2.6 Composite Charts 


The CGL routines can easily generate multiple charts per page, hereafter 
referred to as composite charts. The number and type of charts that can be 
placed on a page is limited only by the user-definable page size. 


c 

i 

c 

4 



-1.0 -.9 -.8 -.7 -.6 -.5 -.4 -.3 -.2 -.1 0 


2y/b 



2y/b 

Vortex flow about a 60* delta wing 


Figure 2-6. Example of a composite chart. 


2-1 2 



3. THE LOW-LEVEL ROUTINES 


This section focuses on the prerequisites .and criteria needed to use the 
Low-Level routines. Since the CGL is written in ANSI FORTRAN 77, resides on 
top of the general purpose graphics package, and has no machine 
dependencies, the following section applies to all machines. However, the 
method of linking this library during execution time, is system dependent, and 
can be found in Appendix D. 

3.1 Introduction 

The Low-Level routines are a group of ANSI FORTRAN 77 routines, which 
utilize the graphics primitives of the underlying graphics package. A graphics 
routine call will either cause graphical operations to be performed (i.e., move, 
draw, etc), or will modify graphical attributes (i.e., color, text size, etc.). The CGL 
includes both the manipulation of graphical output, and the setting of 
environmental attributes, in addition to its own graphical operations. 

The generation of a chart typically consists of displaying data in one or more 
regions associated by a set of scales (i.e., axes, grids, etc.). Subsection 3.3 will 
describe several techniques of establishing several regions, and a method to 
conveniently display the associated data sets. But, in order to use the 
Low-Level routines it is necessary to understand how these routines interface 
with the underlying graphics package. Note, the Section 3.2 will provide an 
overview of the characteristics of the graphical interface, Section 3.3 provides a 
step by step basis demonstrates these points while generating a line chart. 

3.2 Underlying Graphics Package Characteristics used bv the Low-Level 
Routines fusing DI-3000 as an Example) 

The Low-Level routines assume the user is familiar with DI-3000 or a similar 
general purpose graphics package (e.g., GKS). This section will describe how 
the Low-Level routines interface with the underlying graphics package. 
Appendix C contains a list of all DI-3000 routines with a brief description of their 
purpose. 

The basic skeleton of a graphics program is outlined in Figure 3-1, and is 
described in the DI-3000 User's Guide [G-5]. The three major components 
consist of a graphical environment, coordinate systems, and graphical 
primitives and attributes. The Low-Level routines provide an additional set of 
graphical output capabilities with associated attributes. These graphical 


3-1 



capabilities (e.g., axes, grids, etc.), although not themselves primitives (i.e., 
move, draw, etc.) are built using the output primitives of the underlying graphics 
package. 

Most DI-3000 programs have the same basic program structure as shown 
below. The following figure comes from the DI-3000 User's Guide [G-5], and is 
described there in more detail. 


Function 

Subroutine 

— Initialize System 

JBEGIN 

— Initialize Graphics Device 

JDINIT 

— Select Graphics Device 

JDEVON 

Change Defaults 

JDCOLR, JDPEDG, 

Establish Viewing Transformation 

JWINDO, JVPORT,. 

Open Segment 

JOPEN, JROPEN 

Insert Primitives 

JDRAW,... 

Change Attributes 

JCOLOR, JPEDGE, 

Close Segment 

JCLOSE, JRCLOS 

Pause 

JPAUSE 

New Frame Action 

JFRAME 

— Deselect Graphics Device 

JDEVOF 

— Terminate Graphics Device 

JDEND 

— Terminate System 

JEND 


Figure 3-1. DI-3000 basic skeleton program. 


3-2 



3.2.1 Graphical Environment 


The graphical environment consists of the establishment (i.e., initialization and 
termination) of the graphics package and the graphics devices, in addition to 
providing an appropriate graphical context necessary to use the Low-Level 
routines. 

Unlike the CGL LEZ routines which provide a high-level abstract user interface 
incorporating the establishment of the graphical environment, the Low-Level 
routines must be called after the user has ensured the appropriate graphical 
environment has been established. The Low-Level routines only augment the 
existing graphics package capabilities. 

The first Low-Level routine to be called must be CBEGIN. This routine initializes 
all CGL related variables. Each variable has an associated default which is 
assumes when CBEGIN is called. The invocation of CBEGIN is functionally 
independent of DI-3000, and can be called anytime at any place. However, 
subsequent invocations will reset any user defined CGL attributes. 

CALL CBEGIN 

The majority of the Low-Level routines must be called at a point which is 
appropriate to their function. CBEGIN initializes CGL variables and can be 
called anytime; whereas Low-Level routines which perform graphical 
operations (i.e., output, attribute setting, etc.) must be called in context when 
graphical output can be generated. In DI-3000, this context is referred to as an 
opened segment . Figure 3-2, described in the DI-3000 User’s Guide[G-5], 
shows a DI-3000 skeleton program necessary to establish the graphical 
environment. 

Within this framework a combination of DI-3000 based packages may be used. 
For example, DI-3000 primitives and CGL primitives could be invoked 
independently, or in combination. Other DI-3000 graphics packages, such as 
GRAFEASY or GRAFMAKER, may already incorporate parts of the graphical 
environment into its structure, such as initialization/termination, or the 
opening/closing of segments. Thus, each package’s environment may vary. A 
more detailed discussion of how to intermix other graphics packages with the 
Low-Level routines can be found in Section 5. 


3-3 



CALL JBEGIN 
CALL JDINIT (1) 
CALL JDEVON (1) 


CALL JWINDO (...) 

CALL JVPORT (...) 

CALL JOPEN or JROPEN 


CALL JCLOSE or JRCLOS 


Initialize DI-3000. 

Initialize device number 1. 

Activate device number 1. 

(Change default values.) 

Set the window, bordering the objects to be viewed. 
Set the viewport on the display device. 

Open a segment. 

(Graphics output primitives.) 

Close the segment. 


CALL JPAUSE (1) 


Wait for user response. 


CALL JFRAME 


Cause a new frame action. 


CALL JDEVOF (1) 
CALL JDEND (1) 
CALL JEND 


Turn off device number 1. 
Terminate device number 1. 
Terminate DI-3000. 


Figure 3-2. DI-3000 skeleton program. 


3.2.2 Coordinate Systems 

£)nce the appropriate graphical environment and associated primitive attributes 
have been established, then the graphical output routines can be invoked. 
Note, the graphical output will be generated to the current segment which must 
be opened prior bv the user . 

Additionally, the positioning and sizing of the graphical output generated will be 
in accordance with the current coordinate system established (i.e., world and 
virtual coordinate systems). The routine CVSPAC determines the largest 
possible viewspace, based on the width and height passed, and calls JVSPAC 
accordingly. Most notably, this routine sets an internal variable (VUINCH), 
which is the relationship between virtual coordinates and page coordinates. 

Each CGL graphical routine has a unique set of routine arguments and 
attributes. For example, Figure 3-3 illustrates the invocation of the routine 
CNASA. This routine will use the current position (CP) of the present world 
coordinate system and the current text justification (JJUST) to determine the 
current point's relationship within the resultant logo. Figure 3-3 shows a partial 
program using the current coordinate system and the CGL. 


3-4 



oo o o o oo oo oo on 


PROGRAM 


C 

C SIMPLE PROGRAM TO DEMONSTRATE THE USE OF A COORDINATE SYSTEM 

C 

C INITIALIZE DI-3000 
CALL JBEGIN 


THIS MUST BE THE FIRST CGL CALL TO INITIALIZE THE CGL 
CALL CBEGIN 


WRITE TO THE IDEV DEVICE 
IDEV=0 

CALL JDINIT ( IDEV) 
CALL JDEVON ( IDEV) 


SET UP THE VIEWING WINDOW 

CALL JWINDO (0.,11.,0.,11.) 


OPEN CURRENT SEGMENT 
CALL JOPEN 


A LOOP WHICH PRINTS NASA LOGO USING TEXT JUSTIFICATION ( JJUST) , AND 
WORLD COORINDATES (JMOVE) . 

DO 1 1=1,10 

CALL JJUST (1,1) 

CALL JMOVE (REAL (I), 1.) 

1 CALL CNASA(0., 0.3,0) 


ENDS ALL GRAPGICS AND CLOSES CURRENT SEGMENT 
CALL JPAUSE ( IDEV) 

CALL JCLOSE 
CALL JFRAME 
CALL JDEVOF ( IDEV) 

CALL JDEND ( IDEV) 

CALL JEND 
STOP 

END i 


NASA 


NASA 


NASA 


Figure 3-3. Example of the use of a coordinate system. 


3-5 



3.2.3 Page Coordinates and Describing Components 


A convenient approach to aid the user in designing a chart is to establish a 
coordinate system, referred to here as page coordinates , which easily enables 
the user to arrange and describe the chart components. The page coordinates 
can be of any dimension and represent any unit. Since publication-quality 
charts are often requested, the page coordinates described in the document are 
typically in terms of inches to coincide with the postprocessors (plotters). 

A call to CVSPAC will set up the viewspace and viewport, and set appropriate 
internal CGL attributes. For example, the following calls will establish a square 
viewspace, and internally determine how virtual coordinates relate to the 
associated page coordinates. 

CALL CVSPAC ( 9 . , 9 .) 

In this example, the viewspace and viewport will be set to the largest possible 
square on the device. The internal relationship between page coordinates and 
virtual coordinates (determined by CVSPAC) is the extent of the viewspace to a 
9 by 9 region. In DI-3000, the viewspace boundaries are -1 to 1, thus the 
relationship is 2/9. 

CALL JWINDO (0.,9.,0.,9.) 

A call to JWINDO(0.,9.,0.,9.) will establish the current window to match the 
virtual coordination system, and the internal relationship. Note, it is important to 
have the same aspect ratio for the window (JWINDO) and viewport (CVSPAC) 
to avoid distortion. 

Once the page coordinates have been recognized, the user can position and 
describe objects in terms of the page coordinates. For example, the following 
code will output a graphics string as a title, and draw a set of axes to illustrate 
positioning and sizing (as shown in Figure 3-6). 


3-6 



• 

C SET VIEWSPACE AND WINDOW 
CALL CVSPAC ( 9 . , 9 . ) 

CALL JWINDO (0.,9.,0.,9.) 

C OPEN A SEGMENT 
CALL JOPEN 

C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 
CALL JSIZE ( .2, .2*1.25) 

C POSITION STRING, AND SET JUSTIFICATION (CENTER, CENTER) 
CALL JMOVE (4.5, YORG+YLEN+ . 5) 

CALL JJUST (2,2) 

C OUTPUT THE STRING 

CALL JHSTRG ( ' A T [BLC] ITLE ' ) 

C RESET THE CHARACTER SIZE FOR THE AXES 
CALL JSIZE ( .1, .1*1.25) 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
CALL JMOVE (XORG,YORG) 

C DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB ( ’HORIZONTAL AXIS', 1) 

CALL CHAXIS ( 5 . , 10 . , 1 . , XLEN) 

C DESCRIBE THE VERTICAL AXIS 

CALL CVLAB( 'VERTICAL AXIS', 1) 

CALL CVPREC ( 3 ) 

CALL CVAXIS (.0, .01, .001, YLEN) 

A Title 


w 

5 

$ 

£ 


.010 

.009 

.008 

.007 

.006 

.005 

.004 

.003 

.002 

.001 

I 

0 


-J 

10 


horizontal axis 

Figure 3-4. Example of outputting a set of linear axes. 


3-7 



3.2.4 Grap hi cs..Pri m itives an d Attributes 


Each type of output primitive has an associated set of primitive attributes. 
Attributes determine the appearance and characteristics of the graphics output. 
For example, drawing attributes involve such factors as line attributes (i.e., line 
color, line width, etc.), marker attributes (i.e., symbol number, symbol size, etc.), 
polygon attributes (i.e., interior color, interior pattern, etc.), and text attributes 
(i.e., text font, size, and justification). 

The CGL uses a combination of underlying attributes and CGL attributes 
associated with a particular output primitive. The specific attributes required for 
each CGL routine are identified in Appendix A. Thus the user must coordinate 
and keep track of both sets of attributes which affect the graphical output. 
Figure 3-4 shows a partial program using DI-3000 and the CGL primitives and 
attributes. 


• 

C Set the world coordinates to describe page components 
CALL JWINDO (0.,11.,0.,11.) 

C Open the window 

CALL JOPEN 

C Set DI-3000 attributes 
CALL JPINTR(l) 

C Set CGL attributes 

CALL CSYMSZ (0.5) 

DO 1 1=1,10 

C Set the symbol number 

CALL CSYMNO (I) 

C Call the CGL routine to draw a symbol at coorindates (1,1.) 
1 CALL CPNTPT (REAL (I) , 1 . ) 



Figure 3-5. Example of the use of graphics primitives and attributes. 


3-8 




Each CGL attribute is set to a default when CBEGIN is called. To assign 
another value to a CGL attribute, the user should call the specific routine 
associated with the attribute. Most CGL attributes begin with "N" (e.g., NHBTIC, 
NHLABJ, NSYMNO, NSYMSZ, NLNPAT, etc.), and can be assigned through a 
corresponding "C" routine (e.g., CHBTIC, CHLABJ, CSYMNO, CSYMSZ, 
CLNPAT, etc.). 

The CGL attribute values will retain their initial values until overwritten by the 
user. All attribute values will then retain these new values unless subsequently 
changed. Note, reinvoking CBEGIN will set all CGL attributes to their default 
values. Figure 3-5 shows a partial program setting and resetting CGL attributes. 

• 

• 

C INITIALIZE CGL ATTRIBUTES TO DEFAULTS AND SET CURRENT WINDOW 
CALL CBEGIN 

CALL JWINDO (0.,11.,0.,11.) 

C OPEN CURRENT SEGMENT 
CALL JOPEN 

C OUTPUT SYMBOL (WITH DEFAULT SYMBOL NUMBER AND SYMBOL SIZE) 

CALL CPNTPT (1 . , 1 . ) 

C CHANGE SYMBOL NUMBER TO 3, SYMBOL SIZE TO .5, AND DISPLAY 
CALL CSYMNO (3) 

CALL CSYMSZ (.5) 

CALL CPNTPT ( 2., 1.) 

C RESET CGL ATTRIBUTES BACK TO DEFAULTS 
CALL CBEGIN 
CALL CPNTPT ( 3., 1.) 

C END ALL GRAPHICS AND CLOSE CURRENT SEGEMENT 
CALL JPAUSE ( IDEV) 

• 



Figure 3-6. Setting and resetting CGL attributes. 


3-9 



3.3 Steps in the Generation o f Linear an d Logarithmic Line Charts 


This section enumerates and describes the steps needed to generate an XY 
line chart. These steps are explained separately, then combined and illustrated 
as a complete program generating a complete chart. As previously mentioned, 
the three primary ingredients are: 

- establishing a graphical environment; 

- setting the world coordinate systems; and 

- calling the graphical primitives after setting their corresponding attributes. 

This section describes each of these ingredients, and walks through the major 
steps of generating an XY line chart. This section naturally progresses from a 
simple XY line chart with a single data set by adding multiple data sets, 
including a key, and showing how to generate publication-quality axes. 
Subsequent sections address the topics of logarithmic and semi-log axes, and 
grids. 

3.3.1 Ptflttinfl-Linear Data 

Typically, the range of the data coordinates will not coincide with the page 
coordinates. In the previous example, the page coordinates were defined to be 
9 by 9-units, whereas the data ranged from 5 to 10 in the x-direction, and 0.0 to 
0.01 in the y-direction. 

In order to plot the linear data within the area bounded by the axes, the data 
coordinates will need to be mapped onto the page bounded by the axes. A 
convenient approach is to save off the virtual coordinates of the axes 
boundaries described in terms of page coordinates. This is accomplished by 
two calls to JCONWV, one for the lower-left intersection of the axes (i.e., the 
point denoted XORG.YORG), the other for the upper-right boundary of the axes 
(i.e., the point denoted XORG+XLEN, YORG+YLEN). 

• 

C XORG, YORG - THE INTERSECTION OF THE AXES 

C VX1 , VY1 - THE VIRTUAL COORDINATES OF XORG, YORG 

CALL JCONWV (XORG, YORG, 0. ,VX1,VY1) 

C XLEN, YLEN - THE LENGTHS OF THE AXES 

C VX2 , VY2 - THE VIRTUAL COORDINATES OF THE OPPOSITE 

C DIAGONAL OF THE AXES 

CALL JCONWV (XORG+XLEN, YORG+YLEN, 0 . , VX2 , VY2 ) 


3-11 


preceding page blank not filmed 


Next, in order to plot the linear data, which has different scales than the page 
coordinates (i.e., data versus page coordinates), the user must close the 
segment, set the new world coordinates to match the data extremes, then set 
the viewport to match the virtual coordinates corresponding to axes boundaries 
inquired above. In essence, we are mapping the data coordinate system onto 
the virtual coordinates bounded by the axes. Since the data and world 
coordinates are linear, no additional conversion is needed to plot the data. 

• 

• 

CALL JCLOSE 

CALL JWINDO(5., 10., 0. , .01) 

C 5., 10. - X-DIRECTION DATA COORDINATES 
C 0.,.01 - Y-DIRECTION DATA COORDINATES 
CALL JVPORT ( VX1 , VX2 , VYl , VY2 ) 

In case the data exceeds the current world coordinates, set clipping "on" 
(.TRUE.) to suppress unwanted data. 

CALL JWCLIP ( .TRUE. ) 

Finally, open the segment, set the desired plotting attributes, and plot the data. 
The routine CLNPLT will plot an array of values in the current window. Thus, 
the window must be set to match or coincide with the data. The appearance of 
the points to be plotted will be determined by the attributes associated with 
CLNPLT. A few notable attributes are: NSYMNO (symbol number), NSYMSZ 
(symbol size), and NLNPAT (line pattern). After plotting the data, the window for 
the data can be closed. 

CALL JOPEN 
CALL CSYMNO(l) 

CALL CLNPLT (X,Y,NPTS) 

CALL JCLOSE 


3-12 





3.3.2 Complete Program Plotting Multiple Linear DataSets 


The routine CLNPLT must be invoked for every data set. Thus for multiple data 
sets, CLNPLT will be called more than once. To distinguish between the data 
sets, the attributes controlling the data's appearance should be altered. 

CALL JOPEN 

C Plot the first data set with circles and solid lines 
CALL CSYMNO ( 1 ) 

CALL CLNPAT ( 1 ) 

CALL CLNPLT (X,Y1,NPTS) 

C Plot the second data set with squares and dashed lines 
CALL CSYMNO (2) 

CALL CLNPAT (2) 

CALL CLNPLT (X, Y2,NPTS) 

• 

The following is a complete program combining the method previously 
described in context. The corresponding graphics output can be found in 
Figure 3-8. 

PROGRAM CDR5 

C 

C COMPLETE LINE CHART 

C 

C ALLOCATE AND INITIALIZE DATA 

PARAMETER (MAXPTS=1 0,MAXSET=2) 

REAL X ( MAXPTS ) , Y ( MAXPTS , MAXS ET ) 

DATA X/5. 5, 6. 0,6. 5, 7. 0,7. 5, 8. 0,8. 5, 9. 0,9. 5, 10./ 

DATA (Y(KI,1 ) ,KI=1 ,10) 

+ /.001 , .003, .0075, .004, .006, .008, .009, .005, .003, .002/ 

DATA ( Y{KI , 2) ,KI=1 ,10) 

+ /.001 5, .004, .007, .0045, .0065, .0078, .0085, .0055, .0032, .002/ 

C 

C WRITE TO THE DEVICE IDEV 
IDEV=0 
CALL C BEGIN 
CALL JBEGIN 
CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 

C 

C ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC(9. ,9. ) 

CALL JWINDO (0.,9.,0.,9.) 

CALL JOPEN 


3-14 



o o 


C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 

CALL JSIZE( .2, .2*1 .25) 

C POSITION TEXT, AND SET TEXT JUSTIFICATION (CENTER, CENTER) 

CALL JMOVE(4.5,6.0) 

CALL JJUST( 2,2) 

C OUTPUT THE STRING 

CALL JHSTRG( 1 A T(BLC) ITLE' ) 

C RESET THE CHARACTER SIZE FOR THE AXES 
CALL JSIZEt .1 ,.1*1 .25) 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
XORG* 2. 

YORG=2 . 

CALL JMOVE ( XORG , YORG ) 

C DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB( 'H[BLC]ORIZONTAL (BUC) A[BLC)XIS' , 1 ) 

C XLEN - REPRESENTS THE X-AXIS LENGTH 
XLEN=4 . 0 

CALL CHAXIS(5. ,10. ,1 . ,XLEN) 

C DESCRIBE THE VERTICAL AXIS 

CALL CVLAB( ' V( BLC) ERTICAL [BUC] A [BLC] XIS ' , 1 ) 

CALL CVPREC ( 3 ) 

C YLEN - REPRESENTS THE Y-AXIS LENGTH 
YLEN=3 .5 

CALL CVAXIS( .0, .01 , .001 ,YLEN) 

C SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV( XORG, YORG, 0. ,VX1 ,VY1 ) 

CALL JCONWV(XORG+ XLEN, YORG+ YLEN, 0. ,VX2,VY2) 

C CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES ) 

CALL JCLOSE 

C SET WINDOW TO MATCH DATA COORDINATES, AND PLOT WITHIN BOUNDARIES 
C OF THE AXES (BY SAVED VIRTUAL COORDINATES) 

CALL JWINDO(5. , 1 0. , .0, .01 ) 

C 5,10 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE X-DIRECTION 
C 0, .01 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE Y-DIRECTION 
CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 

C PLOT FIRST DATA CURVE 
CALL CSYMNO(I) 

CALL CLNPAT(I) 

CALL CLNPLT( X, Y( 1 , 1 ) , MAXPTS ) 

C SET SYMBOL NUMBER TO 2, AND PLOT SECOND DATA CURVE 
CALL CSYMNO( 2 ) 

CALL CLNPAT( 2 ) 

CALL CLNPLT(X,Y(1 ,2) , MAXPTS) 

CALL JCLOSE 


TERMINATE GRAPHICS 

CALL JPAUSE(IDEV) 

CALL JFRAME 

CALL JDEVOF ( IDEV ) 

CALL JDEND ( IDEV ) 

CALL JEND 

STOP 

END 


3-1 5 



3.3.3 Adding a Kev 


The previous subsections have shown how to establish the graphical 
environment, manipulate coordinate systems, use primitives, and set attributes. 
In context, a simple XY line chart with multiple data sets has been 
demonstrated. The next evolutionary step is the addition of a key. A key is a list 
of words or phrases giving an explanation of symbols or abbreviations (Figure 
2*4 indicates a key in a XY line chart). 

In order to add a key, four steps are necessary: 

1 ) declare and allocate key related variables: 

2) initialize the key related variables by calling CKEYIN; 

3) for each data set to be represented in the key, call CKEYLB. This call 
should be performed when the data is to be drawn, since this routine will 
save off various DI-3000 and CGL attributes currently active; and 

4) finally to plot the key, call CKEYPL. This call should be performed in 
page coordinates. Thus, the window and viewport may have to be reset. 

Step 1 - Declare and allocate variables 

A key is a series of entries (lines), where each entry is stored internally as a 
collection of attributes. The user is required to declare and allocate storage for 
these attributes. Specifically, two variables are needed, ISTORE (storage array 
for attributes) and KEYCHR (storage array for line labels). The dimensions of 
these arrays should be large enough to accommodate the largest number of 
data sets plotted at one time. See the description of the routine CKEYPL in 
Appendix A for a more detailed description. 


C NLINS 
C NCOLS 
C *20 
C 

C (Note, 


PARAMETER (NLINS=2 , NCOLS=l ) 

- the maximum number of lines in the key 

- the number of columns for an entry 

- the largest character string per entry 
(including mnemonics) 

in this example 20 is used, could be any value.) 


CHARACTER KEYCHR (NCOLS, NLINS) *20 
INTEGER ISTORE (15, NLINS) 


3-16 



Step 2 - Initialize the key related variables by calling CKEYIN. This initialization 
can be performed anywhere, at anytime (i.e., the variables passed to CKEYIN 
will be reset). 


C Set window to match data coordinates, and plot within 
C boundaries of the axes 

CALL JWINDO (5. , 10. ,0., 0.01) 

C 5,10 - the data coordinate boundaries in the X-direction 

C 0.,0.01 - the data coordinate boundaries in the Y-direction 

CALL JVPORT ( VX1 , VX2 , VY1, VY2 ) 

CALL JOPEN 

CALL CKEYIN ( ISTORE, KEYCHR, NLINS, NCOLS, NTLINS) 


Step 3 - For each data set to be represented in the key, call CKEYLB. This call 
should be performed when the data is to be drawn, since this routine 
will save off various DI-3000 and CGL attributes currently active. The 
key related variables will be assigned values to be plotted when all 
the key entries have been obtained. This typically requires the 
plotting of the data (in terms of data coordinates). 

• 

C Plot the first data curve using CGL defaults 

CALL CKEYLB (ISTORE, KEYCHR, 3, 'D[BLC]ATA SET 1') 

CALL CLNPLT (X, Y ( 1 , 1 ) , MAXPTS) 

C Set symbol number to 2, line pattern to 2, and plot the 

C second data curve 
CALL CSYMNO ( 2 ) 

CALL CLNPAT ( 2 ) 

C Note, the data attributes must be set prior to CKEYLB 
CALL CKEYLB (ISTORE, KEYCHR, 3, 'D [BLC1ATA SET 2’) 

CALL CLNPLT (X,Y(1, 2) , MAXPTS) 

CALL JCLOSE 



Step 4 - Finally to plot the key, call CKEYPL. When all the key entries have 
been made, a call to CKEYPL will plot the key based on the attributes stored in 
ISTORE and KEYCHR (and a few internal variables). The call to CKEYPL 
should be performed in page coordinates, and since most data is plotted in data 
coordinates (where the attributes are saved by CKEYLB), the window and 
viewport will probably have to be reset. 




c 

c 


c 


Now output the key 

Set the window and viewport for page coordinates 
CALL JVPORT (-l.,l.,-l.,l.) 

CALL JWINDO (0.,9.,0.,9.) 

BPOS (1) =9 . 

BPOS (2 ) =2 . +3 . 5 
CALL JOPEN 

CALL JSIZE (0.1, 0.1*1. 25) 

CALL CKEYPL (ISTORE, KEYCHR, 'K(BLC]EY TITLE 1 , 

+ ' C [BLC ] OLUMN TITLE ', BPOS, 5, JCOL, 1) 

CALL JCLOSE 




Terminate graphics 
CALL JPAUSE ( IDEV) 

CALL JFRAME 
CALL JDEVOF ( IDEV) 

CALL JDEND ( IDEV) 

CALL JEND 

• 


3-18 



3.3.4 Complete Program Plotting Multiple Linear Data Sets with a Kev 


The following program is used to demonstrate how to embed these four steps 
into a complete program. The key related statements have been additionally 
commented for clarity. Figure 3-9 shows the graphics output from the following 
program. 


PROGRAM CDR6 

C 

C COMPLETE LINE CHART WITH A LEGEND 

C 

C ALLOCATE AND INITIALIZE DATA 

PARAMETER (MAXPTS=1 0,MAXSET=2) 

REAL X(MAXPTS) ,Y(MAXPTS,MAXSET) ,BPOS(4) 

PARAMETER (NLINS=2 ,NCOLS=1 ,NTLINS»1 ) 

CHARACTER KEYCHR(NCOLS ,NLINS) *20 
INTEGER ISTOREt 1 5,NLINS ) , JCOL(NCOLS) 

DATA X/5. 5, 6. 0,6. 5, 7. 0,7. 5, 8. 0,8. 5, 9. 0,9. 5, 10./ 

DATA JCOL/1 / 

DATA ( Y(KI , 1 ) ,KI=1 ,10) 

+ /.001 , .003, .0075, .004, .006, .008, .009, .005, .003, .002/ 

DATA (Y(KI,2) ,KI=1 ,10) 

+ /.001 5, .004, .007, .0045, .0065, .0078, .0085, .0055, .0032, .002/ 

C 

C WRITE TO THE DEVICE IDEV 
IDEV=0 
CALL CBEGIN 
CALL JBEGIN 
CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 

C 

C ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC(9. ,9. ) 

CALL JWINDO(0. ,9. ,0. ,9. ) 

CALL JOPEN 

C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 

CALL JSIZE( .2, .2*1 .25) 

C POSITION TEXT, AND SET TEXT JUSTIFICATION (CENTER, CENTER) 

CALL JMOVE (4. 5, 6.0) 

CALL JJUST( 2 , 2 ) 

C OUTPUT THE STRING 

CALL JHSTRGCA T(BLClITLE') 

C RESET THE CHARACTER SIZE FOR THE AXES 
CALL JSIZE( .1 , .1*1 .25) 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
XORG=2 . 

YORG=2 . 

CALL JMOVE (XORG.YORG) 


3-19 


C DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB( 'H[BLC]ORIZONTAL (BUC]AlBLC]XIS' , 1 ) 

C XLEN - REPRSENTS THE X-AXIS LENGTH 
XLEN=4 . 0 

CALL CHAXIS (5«,10.,1 . ,XLEN ) 

C DESCRIBE THE VERTICAL AXIS 

CALL CVLAB( ' Vt BLC ] ERTICAL (BUC] A[BLC]XIS' , 1 ) 

CALL CVPREC( 3) 

C YLEN - REPRESENTS THE Y-AXIS LENGTH 
YLEN=3 .5 

CALL CVAXIS( .0, .01 , .001 , YLEN) 

C SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV(XORG,YORG,0.,VX1,VY1) 

CALL JCONWV ( XORG+XLEN , YORG+YLEN, 0. ,VX2,VY2) 

C CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES) 

CALL JCLOSE 



C SET WINDOW TO HATCH DATA COORDINATES, AND PLOT WITHIN BOUNDARIES 
C OF THE AXES (BY SAVED VIRTUAL COORDINATES) 

CALL JWINDO(5. ,10., .0, .01 ) 

C 5,10 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE X-DIRECTION 
C 0,.01 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE Y -DIRECTION 
CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 

CALL CKEYIN ( ISTORE , KEYCHR, NLINS ,NCOLS ,NTLINS ) 

C PLOT FIRST DATA CURVE 
CALL CSYMNOd ) 

CALL CLNPAT(I) 

CALL CKEYLB( ISTORE, KEYCHR, 3, 'D[BLC)ATA SET 1*) 

CALL CLNPLT (X,Y(1 ,1 ), MAXPTS ) 

C SET SYMBOL NUMBER TO 2, AND PLOT SECOND DATA CURVE 
CALL CSYMNO( 2 ) 

CALL CLNPAT( 2 ) 

CALL CKEYLB( ISTORE, KEYCHR, 3, 'D[BLC]ATA SET 2') 

CALL CLNPLT(X,Y(1 ,2), MAXPTS) 

CALL JCLOSE 

C 

C NOW OUTPUT LEGEND 

C SET WINDOW AND VIEWPORT FOR PAGE COORDINATES 
CALL JVPORT( -1.,1.,-1.,1.) 

CALL JWINDO (0.,9.,0.,9.) 

BPOS ( 1 )=9. 

BPOS(2)=2.+3.5 
CALL JOPEN 

CALL JSIZE{ .1 , .1*1 .25) 

CALL CKEYPL( I STORE, KEYCHR, 'K[ BLC] EY TITLE' ,' C [BLCjOLUMN TITLE’, 

+ BPOS , 5 , JCOL, 1 ) 

CALL JCLOSE 


3-20 



Vertical Axis 


c 

C TERMINATE GRAPHICS 

CALL JPAUSE(IDEV) 

CALL JFRAME 

CALL JDEVOF(IDEV) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


A Title 



Key title 


Column tltie 

O Data set 1 

□ Data Mt 2 


Figure 3-9. Complete XY line chart with a key. 


3-21 


3.3.5 Determining Publication Quality Ax is Scale Factors 


When the range of the data is predetermined, the user can generate a chart with 
appropriate axes scales suitable for publication. When the range of the data is 
unknown, the user can call subroutine CSCALE to aid in determining suitable 
axis characteristics (i.e., scale factors, number of major and minor tick marks, 
etc.). 

First, the user must establish the data's minimum and maximum values: 

CALL CMNMX (X, NPTS, XMIN, XMAX) 

Next, the user can call CSCALE with the minimum and maximum: 


+ 


CALL CSCALE (XMIN, XMAX, AMIN, AMAX, NMAJOR, NMINOR, 
XINCR, NLEFT, NRIGHT) 


where: 

input 

XMIN - array minimum passed into CSCALE 
XMAX - array maximum passed into CSCALE 
output 

AMIN - adjusted minimum 

AMAX - adjusted maximum 

NMAJOR - number of major tick marks 

NMINOR - number of minor tick marks 

XINCR - increments between major tick marks 

NLEFT - number of digits to the left of the decimal place to represent 
number on axis 


NRIGHT - number of digits to the right of the decimal place to represent 
number on axis 


These values can be used to create an axis suitable for publication purposes: 

C CHMTIC set the # of minor tick marks on the horizontal axis 
CALL CHMTIC (NMINOR) 

C CHPREC set the precision for a numeric horizontal axis 
CALL CHPREC (NRIGHT) 

C CHAXIS will draw a horizontal axis of length XLEN, with 
C tick mark labels starting at AMIN to AMAX in increments of 
C XINCR. Axes attributes (e.g., NHMTIC, NHPREC, etc.) are 
C determined by the attributes set when CHAXIS is called. 

CALL CHAXIS (AMIN, AMAX, XINCR, XLEN) 


3-22 



o o o on 


The following is a partial program demonstrating the use of CSCALE to 
generate publication acceptable axis. The graphics output generated from this 
example is found in Figure 3-10. 


PROGRAM CDR7 

C 

C SEMI-LOGARITHMIC LINE CHART (SINGLE DATA SET) 

C 

C SET UP DATA 

PARAMETER (NPTS=6) 

REAL X ( NPTS ) , Y ( NPTS ) , YTEMP ( NPTS ) 

DATA X/2. 2, 3. 0,4. 3, 5.1 ,5. 5, 6. 7/ 

DATA Y/3., 50. ,100., 500. ,750. ,985./ 

DATA XORG/2 . 5/ , YORG/2 . / , XLEN/7 . / , YLEN/7 . / , XPAGE/ 1 1 . / , YPAGE/ 11./ 




RESET THE CHARACTER SIZE FOR THE AXES 
XSIZE=.2 

CALL JSIZE(XSIZE,XSIZE*1 .25) 

POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
CALL JMOVE ( XORG , Y ORG ) 


HORIZONTAL AXIS (LINEAR) 

CALL CMNMX ( X , NPTS , XMIN , XMAX ) 

C DETERMINE PUBLICATION QUALITY SCALE FACTORS 

CALL CSCALE ( XMIN , XMAX , AMIN , AMAX , NMAJOR , NMINOR , XINCR , NLEFT , NRIGHT ) 
C SET HORIZONTAL AXIS ATTRIBUTES 
CALL CHMTIC( NMINOR) 

CALL CHPREC (NRIGHT) 

CALL CHLAB ( 1 F ( BLC ] REQUENCY , ( BUC] H [BLC] Z ' , 1 ) 

CALL CHAXIS (AMIN, AMAX, XINCR, XLEN) 




I— l I I I 1 1 I I I I I I I I I I I I I I I I I I I 

2 3 4 5 6 7 

Frequency, Hz 

Figure 3-10. Example of axis generation with CSCALE. 


3-23 


3.3.6 P lo tti ng Logarithmic Data 


In Subsection 3.3.2, Plotting Linear Data, both the data and the data space 
progressed in a linear fashion (i.e., the scales increase in a proportional 
manner in relationship to the axis). A call to JWINDO with the data extremes 
established a data space encompassing the data to be plotted. Since the 
underlying graphics package only supplies linear windows, logarithmic data 
must be transformed onto a linear coordinate system. This is accomplished by 
converting the logarithmic data by "taking the log of the data", and plotting the 
resultant array onto the linear data space which has the appropriate range. 

A couple of CGL routines are available to aid the user in plotting logarithmic 
data. First, to determine the minimum and maximum of the logarithmic data, the 
user can call CMNMX: 

CALL CMNMX (YARRAY, NPTS, YMIN, YMAX) 

where: 

input 

YARRAY - represents the array containing the logarithmic data 
NPTS - represents the number of points in YARRAY 
output 

YMIN - the returned minimum from YARRAY 
YMAX - the retuned maximum from YARRAY 

Next, to determine the "powers of ten" to use as the axis boundaries, the routine 
CEXP can be used. 

CALL CEXP (YMIN, YMAX, MINEXP, MAXEXP) 

where: 

input 

YMIN - the minimum from YARRAY 
YMAX - the maximum from YARRAY 
output 

MINEXP - the returned minimum exponent 
MAXEXP - the returned maximum exponent 

The returned values, MINEXP and MAXEXP, represent the exponents (i.e., the 
powers of ten) to be used as the axis extremes which will ensure the data will 
be completely encompassed. Also, from these two values, the number of 
logarithmic cycles (intervals) can be determined by MAXEXP-MINEXP, whereas 
the number of major tick marks is determined by (MAXEXP-MINEXP)+1. 


PfcECtDiNt, FA Q£ Pi M,'K ?«iOT 


FILMED 


3-25 



For example, if CMNMX returns 3.0 and 997.0 as the minimum and maximum of 
an array, then CEXP would return MINEXP as 0, and MAXEXP as 3 (i.e., 10**0 
to 10**3, the axis extremes based on the powers of ten to encompass the data). 

To draw a logarithmic axis, the routine CHLOG will draw horizontal axis, while 
CVLOG will draw a vertical axis. 

C Set the initial power of ten used to label the axis 
CALL CHLOGS (MXEXP1) 

C Generate a horizontal log axis of length XLEN, with NTICX 
C major tick marks, with the minor tick marks labeled as 
C denoted by NHLOGI (see CHLOG description in Appendix A) . 

CALL CHLOG (XLEN, NTICX, NHLOGI) 

We now can establish a data space corresponding to these extremes. First, a 
set of logarithmic axes will be positioned and drawn. The following partial 
program illustrates how to draw logarithmic axes. 



C RESET THE CHARACTER SIZE FOR THE AXES 
XSIZE=.2 

CALL JSIZE(XSIZE,XSIZE*1 .25) 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
CALL JMOVE ( XORG , Y ORG ) 



C HORIZONTAL AXIS (LOG) 

CALL CMNMX ( X , MAXPTS , XMIN , XMAX ) 

CALL CEXP (XMIN, XMAX, MXEXP 1 ,MXEXP 2) 

C SET HORIZONTAL AXIS ATTRIBUTES 

CALL CHLAB( ' H[BLC]ORIZONTAL (BUC] A(BLC) XIS ' , 1 ) 

CALL CSET( 1 NHLOGF* , 1 ) 

CALL CSET( 'NHLOGS' ,MXEXP1 ) 

NTICX= ( MXEXP2-MXEXP 1 )+1 
CALL CHLOG ( XLEN , NTICX , 1 ) 



C VERTICAL AXIS (LOGARITHMIC) 

CALL CMNMX ( Y (1,1) , MAXPTS , YMIN , YMAX) 

DO 10 1=2 , MAXSET 

CALL CMNMX ( Y{ 1 , I ), MAXPTS , TMIN , TMAX ) 

I F ( TMIN .LT . YMIN ) YMIN=TMIN 
10 IF(TMAX.GT.YMAX) YMAX=TMAX 

CALL CEXP ( YMIN , YMAX, MYEXP1 ,MYEXP2) 

CALL CVLAB( ' V ( BLC 1 ERTICAL (BUC] A[BLC]XIS ' , 1 ) 

CALL CSET( ' NVLOGF ' , 1 ) 

CALL CSET( ' NVLOGS ' ,MYEXP1 ) 

NTICY= (MYEXP2-MYEXP1 )+1 
CALL CVLOG (YLEN,NTICY, 1 ) 




3-26 



Vertical Axis 


10 * 


10 1 


1 

9 

8 

7 

6 

5 

4 


i 

8 

7 

6 

5 

4 

3 


10° 1 L_ 
1 

10 1 


J I 1 L I L I I I 

2 3 4 567891 

10 * 


Horizontal Axis 

A Title 


Figure 3-1 1 . Example of a set of logarithmic axes. 


3-27 


Next, we must determine what the current virtual coordinates are which bound 
the axes to be used to set the data space and the corresponding virtual 
coordinate system (see Subsection 3.3.2 for a detailed description) 

• 

CALL JCONWV (XORG, YORG, 0 . , VX1, VY1 ) 

C XORG, YORG- The intersection of the axes 
C VX1 , VY1 - The virtual coordinates of XORG, YORG 

CALL JCONWV (XORG+XLEN, YORG+YLEN, 0 . , VX2, VY2) 

C XLEN, YLEN - The lengths of the axes 

C VX2,VY2 - The virtual coordinates of the opposite 
C diagonal of the axes 


Next, we set up the data space and viewport: 

C Set viewport to data region virtual coordinates 
CALL JVPORT (VX1, VX2, VY1, VY2) 

C Set up data region window 

C Since X-axis is log, minimum and maximum must be scaled 
CALL JWINDO (REAL (MXEXP 1 ) , REAL (MXEXP2) , 

+ REAL (MYEXP 1) , REAL (MYEXP2) ) 

C Enable clipping to exclude extraneous data 
CALL JWCLIP ( . TRUE . ) 

To complete the chart we open the segment, set the desired plotting attributes, 
and plot the data. But, we must convert the logarithmic data to correspond to 
the linear data space [i.e., XTEMP(l)=LOG(X(l))]. 

DO 1 1=1 , NPTS 
XTEMP ( I ) =LOG (X(I) ) 

1 YTEMP (I)-LOG(Y(I) ) 

C NOTE: THE ABOVE LOOP ASSUMES THE VALUES IN THE X AND Y 
C ARRAYS ARE GREATER THAN 0. 

CALL JOPEN 
CALL CSYMNO ( 1 ) 

CALL CLNPLT (XTEMP, YTEMP, NPTS) 

CALL JCLOSE 

• 


3-28 





3.3.7 Complete Program Plotting Multiple Logarithmic Data Sets 


The following is a complete program showing the generation of a logarithmic 
chart. This program illustrates the use of CMNMX, CEXP, JCONWV, and the 
mapping of logarithmic data onto a linear scale. The corresponding graphics 
output can be found in Figure 3-13. 

PROGRAM CDR8 



C LOG-LOG LINE CHART (MULTIPLE DATA SETS) 



C SET UP DATA 

PARAMETER ( MAX PTS=6 , MAXSET=2 ) 

REAL X(MAXPTS) , Y (MAXPTS ,MAXSET) , YTEMP ( MAXPTS ) , XTEMP ( MAXPTS ) 

DATA X/22.,30.,43. ,51. ,85; ,97. ./ 

DATA ( Y(KI , 1 ) , KI=1 , MAXPTS )/3.0,50.,10, ,50. ,75. ,98. / 

DATA ( Y( KI , 2 ) ,KI=1 , MAXPTS) /7.0,90.,10.,25. ,55 % ,90. / 

DATA XORG/2 • / , YORG/2 • / , XLEN/7 . / , YLEN/7 . /, XP AGE/1 1 ./,YPAGE/1 1 ./ 

C 

C SET UP GRAPHICS AREA 
IDEV=0 
CALL JBEGIN 
CALL CBEGIN 
CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 

C 

C SET PAGE COORDINATES, AND OPEN A TEMPORARY SEGMENT 
CALL JWINDO(0.,XPAGE,0.,YPAGE) 

CALL JOPEN 



C SET CHARACTER SIZE, AND OUTPUT TITLE 

C SET THE CHARACTER SIZE (IN TERMS OF PAGE CORRDINATES ) 

XSIZE= .25 

CALL JSIZE(XSIZE,XSIZE*1 .25) 

C POSITION STRING, AND SET JUSTIFICATION (CENTER, BOTTOM) 

CALL JMOVE ( XPAGE/ 2 . ,0 .+XSIZE) 

CALL JJUST( 2,1) 

C OUTPUT THE STRING 

CALL JHSTRGCA T(BLCjITLE') 

C 

C RESET THE CHARACTER SIZE FOR THE AXES 
XSIZE= • 2 

CALL JSIZE( XSIZE, XSIZE* 1 .25) 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
CALL JMOVE ( XORG , YORG ) 


3-30 



C HORIZONTAL AXIS (LOG) 

CALL CMNMX( X, MAXPTS , XMIN , XMAX) 

CALL CEXP ( XMIN , XMAX , MXEXP 1 , MXEXP 2 ) 

C SET HORIZONTAL AXIS ATTRIBUTES 

CALL CHLAB( ' H(BLC HORIZONTAL [BUC] A(BLC] XIS ' , 1 ) 

CALL CSET( 1 NHLOGF' , 1 ) 

CALL CSET( 1 NHLOGS 1 ,MXEXP1 ) 

NTICX=(MXEXP2-MXEXP1 )+1 
CALL CHLOG ( XLEN , NTICX , 1 ) 



C VERTICAL AXIS (LOGARITHMIC) 

CALL CMNMX(Y(1 ,1 ), MAXPTS , YMIN, YMAX) 

DO 10 1=2 , MAXSET 

CALL CMNMX(Y(1 ,I),MAXPTS,TMIN,TMAX) 

IF(TMIN .LT. YMIN )YMIN=TMIN 

10 IF(TMAX.GT.YMAX)YMAX=TMAX 

CALL CEXP ( YMIN , YMAX, MYEXP1 , MYEXP2 ) 

CALL CVLAB( ' V [ BLC] ERTICAL [BUC] Al BLC] XIS ' , 1 ) 

CALL CSET( ' NVLOGF ' , 1 ) 

CALL CSET( 'NVLOGS' ,MYEXP1 ) 

NTICY= (MYEXP2-MYEXP1 )+1 
CALL CVLOG ( YLEN , NTIC Y , 1 ) 

C 

C SAVE DATA REGION VIRTUAL COORDINATES 
CALL JCONWV ( XORG , YORG , 0 . ,VX1 , VY1 ) 

CALL JCONWV (XORG+ XLEN, YORG+YLEN,0. ,VX2,VY2) 

CALL JCLOSE 



C SET VIEWPORT TO DATA REGION VIRTUAL COORDINATES 
CALL JVP0RT(VX1 ,VX2,VY1 ,VY2) 



C SET UP DATA REGION WINDOW 

C X-AXIS IS LOG, MIN AND MAX MUST BE SCALED. 

CALL JWINDO ( REAL ( MXEXP 1 ) ,REAL(MXEXP2) , REAL(MYEXP1 ) ,REAL(MYEXP2) ) 
C ENABLE CLIPPING TO EXCLUDE EXTRANEOUS DATA 
CALL JWCLIP( .TRUE. ) 

CALL JOPEN 
C PLOT DATA 

DO 1 KI=1 , MAXPTS 

1 XTEMP (KI ) =L0G1 0(X(KI) ) 

DO 2 KI1 =1 , MAXSET 

CALL CSYMNO(KII) 

CALL CLNPAT(KI1 ) 

DO 3 KI2=1 , MAXPTS 

3 YTEMP ( KI2) =L0G1 0( Y(KI2 ,KI1 ) ) 

2 CALL CLNPLT( XTEMP, YTEMP, MAXPTS) 

CALL JPAUSE(IDEV) 

CALL JCLOSE 
CALL J FRAME 


3-31 



Vertical Axis 




3.3.8 Complete Program Plotting Multiple S emi-Logarit hmic Data Sets 


Throughout the discussion in Section 3.3.2 through 3.3.7, the reader has been 
shown how to generate linear and logarithmic charts. The same techniques 
and principles apply in the generation of semi-logarithmic chart. The following 
program combines these techniques using the linear method on the horizontal 
axis, and the logarithmic method on the vertical axis. 


PROGRAM CDR7 



C SEMI -LOGARITHMIC LINE CHART (SINGLE DATA SET) 

C 

C SET OP DATA 

PARAMETER ( NPTS=6 ) 

REAL X ( NPTS ) , Y ( NPTS ) , YTEMP ( NPTS ) 

DATA X/2. 2, 3. 0,4. 3, 5.1 ,5. 5, 6. 7/ 

DATA Y/3. ,50. ,100., 500., 750., 985./ 

DATA XORG/2 . 5/ , Y0RG/2 . / , XLEN/7 . / , YLEN/7 . / , XPAGE/1 1 . / , YPAGE/ 11./ 

C 

C SET UP GRAPHICS AREA 
IDEV=0 
CALL JBEGIN 
CALL CBEGIN 
CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 

C 

C SET PAGE COORDINATES, AND OPEN A TEMPORARY SEGMENT 
CALL JWINDO( O . , XPAGE, 0 . , YPAGE) 

CALL JOPEN 

C 

C SET CHARACTER SIZE, AND OUTPUT TITLE 

C SET THE CHARACTER SIZE (IN TERMS OF PAGE CORRDINATES) 

XSIZE=.25 

CALL JSIZE( XSIZE, XSIZE*1 .25) 

C POSITION STRING, AND SET JUSTIFICATION ( CENTER , BOTTOM ) 

CALL JMOVE( XPAGE/2 . ,0.+XSIZE) 

CALL JJUST( 2,1) 

C OUTPUT THE STRING 

CALL JHSTRG ( ' P [ BLC ] OWER LEVEL VS. FREQUENCY') 

C 

C RESET THE CHARACTER SIZE FOR THE AXES 
XSIZE=.2 

CALL JSIZE(XSIZE,XSIZE*1 .25) 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
CALL JMOVE ( XORG , YORG ) 


3-33 




C HORIZONTAL AXIS (LINEAR) 

CALL CMNMX( X ,NPTS , XMIN, XMAX) 

C DETERMINE PUBLICATION QUALITY SCALE FACTORS 

CALL CSCALE ( XMIN , XMAX , AMIN , AMAX , NMAJOR , NMINOR , XINCR , NLEFT , NRIGHT) 
C SET HORIZONTAL AXIS ATTRIBUTES 
CALL CHMTIC( NMINOR) 

CALL CHPREC (NRIGHT) 

CALL CHLAB ('Ft BLC ] REQUENCY , ( BUC] H(BLC) Z ' , 1 ) 

CALL CHAXIS( AMIN, AMAX, XINCR,XLEN) 

C 

C VERTICAL AXIS (LOGARITHMIC) 

CALL CMNMX(Y,NPTS,YMIN,YMAX) 

CALL CEXP ( YMIN , YMAX , MINEXP , MAXEXP ) 

CALL CVLAB( 'P[BLC]OWER LEVEL', 1) 

CALL CSET( ’ NVLOGF ' , 1 ) 

CALL CSET( 'NVLOGS' , MINEXP) 

NTIC= ( MAXEXP-MINEXP ) +1 
CALL CVLOG ( YLEN , NT IC , 4 ) 



C SAVE DATA REGION VIRTUAL COORDINATES 
CALL JCONWV ( XORG, YORG, 0 • ,VX1 , VY1 ) 

CALL JCONWV ( XORG+XLEN , YORG+YLEN , 0 . ,VX2,VY2) 

CALL JCLOSE 



C SET VIEWPORT TO DATA REGION VIRTUAL COORDINATES 
CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 



C SET UP DATA REGION WINDOW 
DO 1 KI=1 , NPTS 
1 YTEMP(KI)=LOG10(Y(KI) ) 

C X-AXIS IS LOG, MIN AND MAX MUST BE SCALED. 

CALL JWINDO( AMIN, AMAX, REAL (MINEXP), REAL (MAXEXP) ) 

C ENABLE CLIPPING TO EXCLUDE EXTRANEOUS DATA 
CALL JWCLIP( .TRUE.) 

CALL JOPEN 
C PLOT DATA 

CALL CSYMNO(I) 

CALL CLNPAT(I) 

CALL CLNPLT ( X , YTEMP , NPTS ) 

CALL JPAUSE(IDEV) 

CALL JCLOSE 
CALL JFRAME 



C TERMINATE GRAPHICS 

CALL JDEVOF(IDEV) 

CALL JDEND(IDEV) 

CALL JEND 



STOP 

END 


3-34 




3.3.9 Plotting Data with Grids without Kevs 


The Low-Level routines offer a grid capability for both linear and logarithmic 
scales. This section describes how to generate linear-linear grids, 
semi-logarithmic grids, and log-log grids. Subsequently, this section will 
illustrate how to generate any of these grid types without rectangular areas 
remaining blank (i.e., usually intended for keys). Section 3.3.11 describes grid 
generation with blank areas. 

Two routines are currently available, CGRID and CLGRID. The CGRID routine 
draws a linear grid over a specified plotting area with optional rectangular or 
square areas remaining blank. CLGRID enables the user to draw log-log, 
semi-log, or linear grids with optional blanks for keys. 

Three major steps are needed to generate a grid (either linear or logarithmic). 
The first step is to generate the axes as described in the previous subsections. 
The grid routine will not label the axes, this must be performed (if desired) by 
the axis routines. The second step consists of calling the appropriate grid 
routine (i.e., CGRID or CLGRID) to superimpose a grid onto the axes. The user 
must ensure that these grid intervals match and align with the axes intervals. 
The third step is to close the window (representing page coordinates), open a 
window for the data coordinates, and plot the data. 

The only new step is the generation of grids. A grid extends both in the X and Y 
directions, and may be required to leave a space (hole or area) for a key. 
Unlike, the axis routines which are handled independently, the call to CGRID (or 
CLGRID) will draw the complete grid. The user must therefore supply both axes 
information to the single grid routine. 

To generate a linear grid, a call to CGRID is required. This call must be 
performed in an opened segment, with the window representing page 
coordinates. 


preceding page blank not filmeq 


3-37 



The following is a partial program showing the interaction between axes and 
linear grids. 

• 

CALL JWINDO (0.,9.,0.,9.) 

CALL JOPEN 

CALL JMOVE (XORG, YORG) 

CALL CHAXIS ( 5 . , 10 . , 1 . , XLEN) 

CALL CVAXIS(0., 0.01,0. 001, YLEN) 

C Based on the axes, determine # of intervals 
C X intervals = (XMAX-XMIN) /XINCR 

NOINCX = NINT ( (10.0- 5.0)/1.0 ) 

C X increments 3 * X-axis length/X intervals 
XS = XLEN /REAL (NOINCX) 

C Y intervals = (YMAX-YMIN) /YINCR 

NOINCY = NINT ( (10.0- 5.0) /1.0 ) 

C Y increments* 3 Y-axis length/Y intervals^, 

YS = YLEN /REAL(NOINC^ 

C Since no blank areas, then set NBLANK TO 0 
NBLANK=0 

C Call linear grid routine 

CALL CGRID (XORG, YORG, XS, YS, NOINCX, NOINCY, BLANK, NBLANK) 


The resultant figure is shown in Figure 3-15. 

Similarly, to generate a semi-log or log-log grid, the same approach applies 
where a call to CLGRID replaces CGRID. Refer to Appendix A for a complete 
description of CLGRID, and Appendix B for an example program showing a 
semi-log grid. 


3-38 







3.3.10 Plotting Data with Grids and Keys 


In order to leave a space in a grid for a key, the key extents (height and width) 
must be determined. To do so, the attributes of all data sets must be saved. 
Since saving attributes (i.e., call to CKEYLB) is performed in the data coordinate 
system, and the grid is usually described in page coordinates, the window must 
be reset. 

The following are the major steps in setting up a grid with a space for the key: 

1) generate the axes (page coordinates) 

2) draw the data (data coordinates), while saving key related attributes 

3) determine key extents, and call the grid routine with key extents (page 
coordinates) 

4) plot the key 

Steps 1 and 2 are explained in previous subsections. 

Step 3 - Once all the data sets have been plotted (i.e., all of the key related 
attributes have been saved), then the key extents can be determined. A call to 
CKEYPL with the variable KPT set to 1, will return the lower-left X and Y 
coordinates in BPOS(1),BPOS(2), and the upper-right X and Y coordinate in 
BPOS(3), BPOS(4). 


KPT=1 

CALL CKEYPL ( ISTORE, KEYCHR, CTTL, BPOS, KPT, ICOL,NHPR) 

C BPOS (1) , BPOS (2) = the lower-left corner (XY coordinate) 
C BPOS (3) , BPOS ( 4 ) = the upper-right corner (XY coordinate) 
C Calculate the X and Y extents 
XXTENT=BPOS (3) -BPOS (1) 

YXTENT=BPOS ( 4 ) -BPOS ( 2 ) 




These extents can then be passed to the grid routine to suppress the grid lines 
through this area. 



Step 4 - Now that the user knows the dimensions of the key, the user must 
determine where to position the key in relationship to the chart. It is preferred 
for publications that the grid lines stop on grid lines, as opposed to grid lines 
which dangle (see Figure 3-16). Thus, even though the user determines the 
extents, the user must further determine the dimensions of the grid lines to 
suppress. These dimensions are then passed to the grid routine (i.e., either 
CGRID or CLGRID), and the key should be centered in the grid space requested 
to be blank. 




preferred 


non-preferred 


Figure 3-16. Sample grids with keys. 


3-41 


To request blank space in a grid, the variables NBLANK and BLANK are used 
to inform the grid routine. NBLANK indicates the number of blank areas. 
BLANK is an array the coordinates (representing the diagonals) of the rectangle 
to be left. 


c 

c 


c 


The number of blank regions 
NBLANK=2 


Coordinates 
BLANK (1) = 
BLANK (2) = 
BLANK (3) - 
BLANK (4) = 

BLANK ( 5) = 
BLANK ( 6) = 
BLANK ( 7) = 
BLANK ( 8) = 


of the blank 
{ lower-left 
{ lower-left 
{upper-right 
{upper-right 

{ lower-left 
{ lower-left 
{upper-right 
{upper-right 


regions 
X coordinate 

Y coordinate 
X coordinate 

Y coordinate 

X coordinate 

Y coordinate 
X coordinate 

Y coordinate 


of region 1} 
of region 1 } 
of region 1} 
of region 1} 

of region 2 } 
of region 2 } 
of region 2} 
of region 2} 




Program CDR1 1 in Appendix B, is a complete program demonstrating these 
steps. 


3-42 



3.3.11 




* 


This subsection describes how to generate line charts with axes other than the 
standard linear/logarithmic vertical and horizontal axes. Examples of 
non-standard axes include (see Figure 3-17): 

- decreasing scales: axes which have a negative increment 

- multiple scales: two or more vertical or horizontal axes 

- interior axes: axes which are interior to the data space 

- disjoint axes: axes which do not intersect 



a) decreasing scales b) multiple scales 


>■ 



* not publication stancard 


Figure 3-1 7. Examples of non-standard axes. 


Note: shaded areas represent the data space denoted by the axes. 


3-43 



3.3.11.1 Plotting Data with a Decreasing Axis 


A decreasing axis is a numeric axis with negative increments. Thus, the values 
on a horizontal axis decrease from left to right, while the values on a vertical 
axis decrease from bottom to top (see Figure 3-18). 





*• 


Figure 3-18. Example of decreasing axes. 

In order to plot data with decreasing axes (or axis), two major steps must be 
performed: 

1) the generation of the axes; and 

2) the plotting of the data to coincide with the axes. 

The generation of a decreasing numeric axis is obtained using a call to CHAXIS 
(for horizontal axes) or CVAXIS (for vertical axes). To generate axes with 
decreasing values the appropriate arguments must be passed (i.e., the starting 
value less than the ending value, and a negative increment). Note, a 
decreasing axis can also be generated using CHAXIC or CVAXIC, with the axis 
labels having character strings representing the decreasing values. 

Since windows (data spaces) in underlying graphics packages are usually 
increasing in nature, the user must manipulate the decreasing data to conform 
the increasing window. This entails the usual process of drawing the axes, and 
setting the window and viewport to match the axes. Then because axis is 
decreasing to match the data, and the window must be increasing, the data has 
to be mapped to match the world. For example, if the horizontal axis decreases 
from 10 to 5, the axis should reflect this decrease, while the corresponding 
window should be set to 5 to 10. Next, the data set (or sets) coinciding with the 
decreasing axis must be adjusted to reflect the window in which the data is to 
be plotted. To aid in this process, the routine CFLIP has been written. The user 


3-44 




passes the data set, the number of points, and the reflection point about which 
the data is to be mapped. CFLIP will return the array of points offset from the 
reflection point on the reflection point's opposite side. For example, given a 
value 8 and a reflection point 5, CFLIP will return a value of 2 (i.e., an equal 
distance from the reflection point on the other side). Note, the original value 
passed through CFLIP can be obtained by passing the adjusted value with the 
x same reflection point (i.e., given a value 2 and a reflection point 5, CFLIP will 

return a value of 8). 

The following is a complete program illustrating a decreasing axis, and the use 
* of CFLIP to adjust the data. See Figure 3-19 for the resultant chart. 

PROGRAM CDR12 



C A LINE CHART WITH A DECREASING AXIS. 

C 

C ALLOCATE AND INITIALIZE DATA 

PARAMETER (MAXPTS-1 0,MAXSET-2) 

REAL X(MAXPTS) ,Y(MAXPTS,MAXSET) 

DATA X/5. 5, 6. 0,6. 5, 7. 0,7. 5, 8. 0,8. 5, 9. 0,9. 5, 10./ 

DATA (Y(KI,1 ) ,KI=1 ,10) 

+ /.001 , .003, .0075, .004, .006, .008, .009, .005, .003, .002/ 

DATA (Y(KI,2),KI«1,10) 

+ / .0015, .004, .007, .0045, .0065,. 0078, .0085, .0055, .0032, .002/ 

C 

C WRITE TO THE DEVICE IDEV 
IDEV=0 
CALL CBEGIN 
CALL JBEGIN 

v CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 



C ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC(9. ,9. ) 

CALL JWINDO (0. ,9. , 0 . , 9 . ) 

CALL JOPEN 

C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 

CALL JSIZE( .2, .2*1 .25) 

C POSITION TEXT, AND SET TEXT JUSTIFICATION (CENTER, CENTER) 

CALL JMOVE(4.5,6.0) 

CALL J JUST (2, 2) 

C OUTPUT THE STRING 

CALL JHSTRGCA T[BLC]ITLE') 

C RESET THE CHARACTER SIZE FOR THE AXES 
CALL JSIZE(.1 ,.1*1.25) 


3-45 


c POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
XORG=2. 

YORG*2 . 

CALL JMOVE ( XORG , YORG ) 

C DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB( ' H [BLC] RIZONTAL [BUC] A[BLC]XIS ' , 1 ) 

C XLEN - REPRESENTS THE X-AXIS LENGTH 
XLEN=4 . 0 

CALL CHAXIS( 10. ,5. ,-1 . ,XLEN) 

C DESCRIBE THE VERTICAL AXIS 

CALL CVL AB ( ' V l BLC ] ERTICAL [BUC]A[BLC]XIS' , 1 ) 

CALL CVPREC( 3) 

C YLEN - REPRESENTS THE Y-AXIS LENGTH 
YLEN=3.5 

CALL CVAXIS( .0, .01 , .001 ,YLEN) 

C SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV(XORG, YORG, 0..VX1 ,VY1 ) 

CALL JCONWV ( XORG+XLEN , YORG+YLEN , 0 . ,VX2,VY2) 

C CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES) 

CALL JCLOSE 



C SET WINDOW TO MATCH DATA COORDINATES, AND PLOT WITHIN BOUNDARIES 
C OF THE AXES (BY SAVED VIRTUAL COORDINATES) 

C NOTE: THE WINDOW OF THE UNDERLYING GRAPHICS PACKAGE MUST BE 
C INCREASING IN NATURE. THE RANGE MUST MATCH THE DATA. 

CALL JWINDO(5. ,10. , .0, .01 ) 

C 5,10 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE X-DIRECTION 
C 0,.01 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE Y-DIRECTION 
CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 

C FLIP THE DATA ABOUT A REFLECTION POINT (I.E., MIRROR IMAGE). 

C REFLECT = ( XMAX-XMIN) /2 . + XMIN 

REFLECT=( 10. - 5.)/2. + 5. 

CALL CFLIP(X,MAXPTS, REFLECT) 

CALL JOPEN 

C PLOT FIRST DATA CURVE USING CGL DEFAULTS 
CALL CSYMNO(1 ) 

CALL CLNPAT( 1 ) 

CALL CLNPLT ( X , Y ( 1 , 1 ) , MAXPTS ) 

C SET SYMBOL NUMBER TO 2, AND PLOT SECOND DATA CURVE 
CALL CSYMNO( 2 ) 

CALL CLNPAT( 2 ) 

CALL CLNPLT(X,Y(1 ,2) , MAXPTS) 

CALL JCLOSE 

C IF THE X ARRAY IS TO BE USED AGAIN, THE USER MUST APPLY CFLIP AGAIN. 
C IN THIS CASE, THE X ARRAY IS NOT USED AGAIN. 

C 



C TERMINATE GRAPHICS 

CALL JPAUSE(IDEV) 

CALL JFRAME 

CALL JDEVOF ( IDEV ) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


A Title 



Hrizontol Axla 


Figure 3-19. Complete program with a decreasing axis. 


3-47 


3.3.11.2 Line Charts with Multiple Scales on an Axis 


This subsection describes how to generate line charts with two or more scales 
on the horizontal or vertical axis. In order to have multiple scales on the same 
axis, the user must map two windows (with different data extents) onto the same 
viewport. Thus, the user must set a viewport and window, and plot the 
appropriate data. Next, the user closes the current segment, resets the window 
to match the next scale, and plots the data. 

The user is referred to previous sections for instructions on generating axes. 
The following example, however, illustrates the use of mapping two scales (of 
an axis) onto the same viewport. See Figure 3*20 for the resultant output. 


PROGRAM CDR13 



C A LINE CHART WITH MULTIPLE VERTICAL SCALES ON THE SAME AXIS. 

C 

C ALLOCATE AND INITIALIZE DATA 

PARAMETER (MAXPTS*1 0,MAXSET*2) 

REAL X ( MAXPTS ) , Y ( MAXPTS , M AXSET ) , BPOS ( 4 ) 

PARAMETER (NLINS=2,NCOLS=1 ,NTLINS=1 ) 

CHARACTER KEYCHR(NCOLS ,NLINS ) *20 
INTEGER ISTORE(15,NLINS) ,JCOL(NCOLS) 

DATA X/5. 5, 6. 0,6. 5, 7. 0,7. 5, 8. 0,8. 5, 9. 0,9. 5, 10./ 

DATA JCOL/1 / 

DATA (Y(KI,1 ) ,KI»1 ,10) 

+ /.001 ,.003, .0075, .004, .006, .008, .009, .005 , .003, .002/ 

DATA (Y(KI,2) ,KI«1 ,10) 

+ /.001 5, .004, .007, .0045, .0065, .0078, .0085, .0055, .0032, .002/ 



C WRITE TO THE DEVICE IDEV 
IDEV-0 
CALL CBEGIN 
CALL JBEGIN 
CALL JDINIT(IDEV) 

CALL JDEVON(IDEV) 



C ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC(9. ,9. ) 

CALL JWINDO(0. ,9. ,0. ,9. ) 

CALL JOPEN 

C 


3*48 



on n on on non no on 


C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 
CSIZE=.2 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

C POSITION TEXT, AND SET TEXT JUSTIFICATION (CENTER, CENTER) 
CALL JMOVE (4.5, . 5 ) 

CALL JJUST( 2,2) 

C OUTPUT THE STRING 

CALL JHSTRG( 'A T(BLC) ITLE' ) 

C RESET THE CHARACTER SIZE FOR THE AXES 
CSIZE=.1 

CALL JSIZE(CSIZE,CSIZE*1 . 25) 


POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
XORG=2. 

YORG=2 . 

CALL JMOVE (XORG,YORG) 

DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB( 'W[BLC]ING LENGTH', 1) 

XLEN - REPRSENTS THE X-AXIS LENGTH 
XL EH =4.0 

CALL CHAXIS ( 5 . , 1 0. , 1 . , XLEN ) 


DESCRIBE THE VERTICAL AXIS 
NO AXIS LABEL ON INNERMOST VERTICAL AXIS 
CALL CVLAB( * ' ,0) 

CALL CVPREC( 3 ) 

YLEN - REPRESENTS THE Y-AXIS LENGTH 
YLEN=3.5 

PLOT FIRST AXIS (DECREASING) 

CALL CVAXIS( .01 , .0,-.001 ,YLEN) 

CALL JMOVE ( XORG , YORG+YLEN+ .75) 

CALL JHSTRG( ' (BLC)CM' ) 

PLOT SECOND AXIS (INCREASING) 

POSITION AND DESCRIBE THE OUTMOST VERTICAL AXIS 
CALL JMOVE (XORG-CSIZE*7. ,YORG) 

CALL CVLAB( 'W[BLC]ING WIDTH', 1) 

CALL CVAXIS( .0, .01 , .001 ,YLEN) 

LABEL FOR OUTMOST VERTICAL AXIS 

CALL JMOVE ( XORG-CS I ZE *7 . , YORG+YLEN+ .75) 

CALL JHSTRG( ' (BLC]IN. ' ) 


SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV(XORG,YORG,0. ,VX1 ,VY1 ) 

CALL JCONWV ( XORG+XLEN , YORG+YLEN , 0 . ,VX2,VY2) 

C CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES) 
CALL JCLOSE 

C 


3-49 


n o 


C SET WINDOW TO MATCH DATA COORDINATES, AND PLOT WITHIN BOUNDARIES 
C OP THE AXES (BY SAVED VIRTUAL COORDINATES) 

CALL JWINDO (5.,10.,.0,.01) 

C 5,10 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE X-DIRECTION 
C 0, .01 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE Y -DIRECT ION 
CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 

CALL CKEYIN ( ISTORE, KEYCHR , NLINS , NCOLS , NTLINS ) 

C FLIP THE DATA ABOUT A REFLECTION POINT (I.E., MIRROR IMAGE). 

C REFLECT - (YMAX-YMIN)/2. + YMIN 
REFLECT* ( .01 - 0.)/2. + 0. 

CALL CFLIP( Y( 1,1) , MAXPTS , REFLECT ) 

C PLOT FIRST DATA CURVE WITH DECREASING AXIS (USING CGL DEFAULTS) 

CALL CSYMNO(I) 

CALL CLNPAT ( 1 ) 

CALL CKEYLB( ISTORE, KEYCHR, 3, 'D(BLC] ECREASING AXIS DATA SET 1’) 
CALL CLNPLT(X,Y(1 ,1), MAXPTS) 

C REVERSE DATA AGAIN, TO RETURN DATA TO ORIGINAL VALUES. 

CALL CFLIP(Y(1,1),MAXPTS, REFLECT) 

C SET SYMBOL NUMBER TO 2, AND PLOT SECOND DATA CURVE 
CALL CSYMNO( 2) 

CALL CLNPAT ( 2 ) 

CALL CKEYLB (I STORE, KEYCHR, 3, ' I [BLC Increasing axis DATA SET 2') 

C PLOT SECOND DATA CURVE WITH INCREASING AXIS. 

CALL CLNPLT(X,Y( 1,1), MAXPTS) 

CALL JCLOSE 



C NOW OUTPUT LEGEND 

C SET WINDOW AND VIEWPORT FOR PAGE COORDINATES 
CALL JVPORT (-1.,1.,-1.,1.) 

CALL JWINDO(0. ,9. ,0. ,9. ) 

BPOS ( 1 ) *9 . 

BPOS(2)*2.+3.5 
CALL JOPEN 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

CALL CKEYPL ( I STORE , KEYCHR , ' M ( BLC ] ULTIPLE AXIS’, 

+ ' C ( BLC ] OLUMN TITLE' , BPOS, 5, JCOL, 1 ) 

CALL JCLOSE 


TERMINATE GRAPHICS 

CALL JPAUSE(IDEV) 

CALL J FRAME 

CALL JDEVOF(IDEV) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


3-50 



Wing Width 


inches cent 



Multiple axis 


Column title 

O— — — Decreasing axis 
D Increasing axis 


Wing Length 


A Title 


Figure 3-20. Example of multiple vertical scales on the same axis. 


3-51 



The following example illustrates the use of mapping of two scales (of an axis) 
onto the opposite side of the chart. See Figure 3*21 for the resultant output. 

PROGRAM CDR14 

C 

C LINE CHART WITH MULTIPLE VERTICAL SCALES (OPPOSITE AXIS) 


C ALLOCATE AND INITIALIZE DATA 

PARAMETER ( MAXPTS* 1 0, MAXSET=2 ) 

REAL X ( MAXPTS ) , Y ( MAXPTS , MAXSET ) , BPOS ( 4 ) 

PARAMETER ( NLINS=2,NCOLS=1 ,NTLINS=1 ) 

CHARACTER KEYCHR(NCOLS ,NLINS ) *20 
INTEGER I STORE ( 1 5,NLINS) , JCOL(NCOLS) 

DATA X/5. 5, 6. 0,6. 5 ,7. 0,7. 5 ,8. 0,8. 5, 9. 0,9. 5, 10./ 

DATA JCOL/1 / 

DATA (Y(KI,1),KI=1,10) 

+ /.001 , .003, .0075, .004, .006, .008, .009, .005, .003, .002/ 

DATA (Y(KI,2) ,KI=1 ,10) 

+ /.001 5, .004, .007, .0045, .0065 , .0078 , .0085 , .0055, .0032, .002/ 

C 

C WRITE TO THE DEVICE IDEV 
IDEV=0 
CALL CBEGIN 
CALL JBEGIN 
CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 

C 

C ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC(9. ,9. ) 

CALL JWINDO(0. ,9.,0.,9.) 

CALL JOPEN 

C 

C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 

CSIZE=.2 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

C POSITION TEXT, AND SET TEXT JUSTIFICATION (CENTER, CENTER) 

CALL JMOVE (4.5, .5) 

CALL JJUST( 2,2) 

C OUTPUT THE STRING 

CALL JHSTRGCA TtBLC] ITLE' ) 

C RESET THE CHARACTER SIZE FOR THE AXES 
CSIZE=. 1 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

C 


3-52 



o o 


C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
XORG* 1 .25 
YORG=2 . 

CALL JMOVE ( XORG , YORG ) 

C DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB( 'HlBLClORIZONTAL (BUCl A[BLC]XIS' , 1 ) 

C XLEN - REPRSENTS THE X-AXIS LENGTH 
XLEN=4 . 0 

CALL CHAX IS (5., 10. ,1., XLEN ) 

C 

C DESCRIBE THE VERTICAL AXIS 
C NO AXIS LABEL ON INNERMOST VERTICAL AXIS 
CALL CVLAB( ’DlBLClECREASING AXIS', 1) 

CALL CVPREC( 3 ) 

C, YLEN - REPRESENTS THE X-AXIS LENGTH 
-i YLEN=3 . 5 

C PLOT FIRST AXIS (DECREASING) 

CALL CVAXIS( .01 , .0,-.001 , YLEN) 

C PLOT SECOND AXIS (INCREASING) 

C POSITION AND DESCRIBE THE OPPOSITE VERTICAL AXIS 
CALL JMOVE (XORG+ XLEN, YORG) 

C REQUEST VERTICAL AXIS TICK MARKS TO THE RIGHT OF THE AXIS. 

C CALL CVTICJ(2) 

C REQUEST VERTICAL AXIS TICK MARK LABELS TO THE RIGHT OF THE AXIS. 
CALL CVLABJM ) 

CALL CVTICJ ( 2 ) 

CALL CVLAB( ' I { BLC] NCREASING AXIS',1) 

CALL CVAXIS ( .0, .01 , .001 , YLEN) 


SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV( XORG, YORG, 0. ,VX1 ,VY1 ) 

CALL JCONWV(XORG+ XLEN, YORG+ YLEN, 0. ,VX2,VY2) 

C CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES) 

CALL JCLOSE 

C 

C SET WINDOW TO MATCH DATA COORDINATES, AND PLOT WITHIN BOUNDARIES 
C OF THE AXES (BY SAVED VIRTUAL COORDINATES) 

CALL JWINDO( 5 , , 1 0. , .0, .01 ) 

C 5,10 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE X-DIRECTION 
C 0,.01 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE Y-DIRECTION 
CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 

CALL CKEYIN ( I STORE , KEYCHR , NLINS , NCOLS , NTLINS ) 

C FLIP THE DATA ABOUT A REFLECTION POINT (I.E., MIRROR IMAGE). 

C REFLECT = (YMAX-YMIN)/2. + YMIN 
REFLECT* ( .01 - 0,)/2. + 0. 

CALL CFLIP(Y( 1,1) ,MAXPTS .REFLECT) 


3-53 


C PLOT FIRST DATA CURVE WITH DECREASING AXIS 
CALL CSYMNO(I) 

CALL CLNPAT ( 1 ) 

CALL CKEYLB ( I STORE , KEYCHR , 3 , ' D [ BLC ] ECREASING DATA') 
CALL CLNPLT ( X , Y ( 1 ,1 ) , MAXPTS ) 

C REVERSE DATA AGAIN, TO RETURN DATA TO ORIGINAL VALUES. 

CALL CFLIP( Y (1,1), MAXPTS , REFLECT) 

C SET SYMBOL NUMBER TO 2, AND PLOT SECOND DATA CURVE 
CALL CSYMNO( 2) 

CALL CLNPAT ( 2 ) 

CALL CKEYLB( ISTORE, KEYCHR, 3, 1 1 [BLC INCREASING DATA') 
C PLOT SECOND DATA CURVE WITH INCREASING AXIS. 

CALL CLNPLT(X,Y(1 ,2) , MAXPTS) 

CALL JCLOSE 



C NOW OUTPUT LEGEND 

C SET WINDOW AND VIEWPORT FOR PAGE COORDINATES 
CALL JVPORT (-1.,1.,-1.,1.) 

CALL JWINDO (0.,9.,0.,9.) 

BPOS ( 1 ) =9 . 

BPOS( 2 ) =2 . + 3 .5 
CALL JOPEN 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

CALL CKEYPL ( I STORE , KEYCHR , 1 M [ BLC ] ULTIPLE AXIS', 

+ ' D [ BLC ] ATA TYPE 1 , BPOS , 5 , JCOL , 1 ) 

CALL JCLOSE 

C 

C TERMINATE GRAPHICS 

CALL JPAUSE(IDEV) 

CALL JFRAME 
CALL JDEVOF(IDEV) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


3-54 



Decreasing axis 



Horizontal Axis 


.010 

.009 

.008 

.007 

.006 

.005 

.004 

.003 

.002 

.001 

0 


jn 

x 

o 

o* 

c. 

a 

o 

e 

h. 

o 

c 


Multiple axis 


Data type 

O Decreasing data 

□ Increasing data 


A Title 


Figure 3-21. Example of multiple vertical scales on opposite axis. 


3-55 



3.3.11.3 Line Charts with Interior Axes 


In order to have interior axes, the user must establish the window and viewport 
to encompass the axes. 

The user is referred to previous sections for instructions of generating axes. 
The following example, however, illustrates the use of interior axes. See Figure 
3-22 for the resultant output. 

PROGRAM CDR15 



C SIMPLE, YET COMPLETE LOW-LEVEL PROGRAM (WITH A KEY) 



C ALLOCATE AND INITIALIZE DATA 

PARAMETER( NUMPT1 «1 3 , NUMPT2*3 , MAXLAB*20 ) 

REAL XI (NUMPT1 ) ,Y1 (NUMPT1 ) , BPOS(4) 

REAL X2(NUMPT2) ,Y2(NUMPT2) 

PARAMETER (NLINS-2 ,NCOLS*1 ,NTLINS*1 ) 

CHARACTER KEYCHR ( NCOLS , NLINS ) *2 0 , CLABS ( MAX LAB ) * 1 0 
INTEGER ISTORE( 1 5 ,NLINS ) ,JCOL( NCOLS) 

DATA XI /-8., -6., -4., -2. ,0., 2., 4., 6., 8,, 10., 12., 14., 16./ 

DATA JCOL/1 / 

DATA (Y1 (KI) ,KI-1 ,NUMPT1 ) 

+ /.079, .068, .035, . 021,. 0,-. 021 , -.035, -.065,-. 08, -.1 1 , 

+ -.1 18, -.12, -.139/ 

DATA X2/-4. ,8. ,16./, Y2/. 039, -.071 ,-.145/ 



C WRITE TO THE DEVICE IDEV 
IDEV-0 
CALL CBEGIN 
CALL JBEGIN 
CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 



C ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC(9. ,9. ) 

CALL JWINDO(0. ,9. ,0. ,9. ) 

CALL JOPEN 

C 

C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 

CSIZE=.2 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

C POSITION TEXT, AND SET TEXT JUSTIFICATION (CENTER, TOP) 

CALL JMO VE ( 9 . / 2 . ,9. -.5) 

CALL JJUST(2,3) 

C OUTPUT THE STRING 

CALL JHSTRG( 'CtBLClOMPUTATIONS VS[ELC] E[BLC]XPERIMENTS' ) 


3-56 



o o on o ooo oo o oo oo 


C RESET THE CHARACTER SIZE FOR THE AXES 
CSIZE= . 1 

CALL JSIZE(CSIZE,CSIZE*1 .25) 


BASED AXES DATA ATTRIBUTES (MINIMUM, MAXIMUM, AND INCREMENTS). 
XMIN=-8. 

XMAX=20. 

XINC=4 . 

YMIN=- . 1 6 
YMAX=0 . 1 2 
YINC=.04 


SET X AND Y AXIS LENGTHS (I.E., XLEN AND YLEN RESPECTIVELY). 
XLEN=4.0 
YLEN=5 . 5 

POSITION LOWER-LEFT CORNER OF DATA SPACE ON THE PAGE. 

XORG=( (9./2.)-1.) - .5* XLEN 
YORG=(9./2. )-.5*YLEN 

NOW, SET XZERO AND YZERO PAGE COORDINATES WHERE AXES 0,0 EXISTS. 
(THIS PROGRAM ASSUMES THAT DATA ENCOMPASSES 0,0 IN X AND Y). 
XZERO=XORG+XLEN* (-XMIN/ (XMAX-XMIN) ) 

YZERO=YORG+YLEN* ( - YMIN/ ( YMAX-YMIN ) ) 


DESCRIBE X-AXIS. MOVE TO X ORIGIN, Y ZERO. 

CALL JMOVE(XORG, YZERO) 

GENERATE X AXIS LABELS. 

CALL CILAB ( XMIN , XMAX , XINC , 0 , CLABS ) 
ICOUNT=N INT ( (XMAX- XMIN) /XINC )+1 
BLANK OUT INTERSECTION LABEL (I.E., 0). 
KI=NINT( ABS ( XMIN) /XINC)+1 
CLABS (KI)=‘ ' 

DRAW AXIS 

CALL CHAXIC( XLEN, ICOUNT, CLABS, 1 ,ICOUNT). 
POSITION AND OUTPUT AXIS LABEL 

CALL JMOVE( XORG+ ( 5 . /7 . ) * XLEN, YZERO- . 5 ) 
CALL JHSTRG( ' (FONT=9) [BLC] A(FONT=3] ,DEG’ ) 


DESCRIBE Y-AXIS. MOVE TO X ZERO, Y ORIGIN. 
CALL JMOVE( XZERO, YORG) 

C GENERATE Y AXIS LABELS. 

CALL CILAB(YMIN,YMAX,YINC,2,CLABS) 
ICOUNT=N I NT ( ( YMAX-YMIN )/YINC)+1 . 

C BLANK OUT INTERSECTION LABEL (I.E., 0). 
KI=NINT( ABS ( YMIN) /YINC)+1 
CLABS (KI ) = 1 ' 

C DRAW AXIS. 

CALL CVAXIC( YLEN, ICOUNT, CLABS, 1 ,ICOUNT) 
C POSITION AND OUTPUT AXIS LABEL 

CALL JMOVE( XZERO- 1 . , YORG+ (2.5/7.) *YLEN) 
CALL JHSTRG( 'C(BLC] (BSUB]M (0.250 ') 

C 


3-57 



0 o 


C SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV ( XORG, YORG, 0. ,VX1 , VY1 ) 

CALL JCONWV ( XORG+XLEN , YORC ' YLEN , 0 • ,VX2,VY2) 

C CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES) 

CALL JCLOSE 



C SET WINDOW TO HATCH DATA COORDINATES, AND PLOT WITHIN BOUNDARIES 
C OF THE AXES (BY SAVED VIRTUAL COORDINATES) 

CALL JWINDO ( XMIN , XMAX , YMIN , YMAX) 

C XMIN, XMAX - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE X-DIRECTION 
C YMIN, YMAX - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE Y-DIRECTION 
CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 

CALL CKEYIN ( ISTORE,KEYCHR,NLINS,NCOLS ,NTLINS ) 

C PLOT FIRST DATA CURVE USING CGL DEFAULTS 
C SET SYMBOL TO 1 (A CIRCLE) FOR EXPERIMENTAL DATA. 

CALL CSYMNO(I) 

CALL CKEYL8( ISTORE,KEYCHR,3, 1 E ( BLC ) XPERIMENTAL ' ) 

CALL CLNPLT(X1 ,Y1 ,NUMPT1 ) 

C PLOT SECOND DATA CURVE. 

C SET SYMBOL TO SOLID SQUARE (ACTUAL), AND PLOT SYMBOLS ONLY. 

CALL CSYMNO(902) 

CALL CPLTYP ( - 1 ) 

CALL CKEYLB ( I STORE , KEYCHR , 3 , ' A [ BLC ) CTUAL ' ) 

CALL CLNPLT(X2,Y2,NUMPT2) 

CALL JCLOSE 



C NOW OUTPUT LEGEND 

C SET WINDOW AND VIEWPORT FOR PAGE COORDINATES 
CALL JVPORT (-1.,1.,-1.,1.) 

CALL JWINDO ( 0.,9.,0.,9.) 

BPOS ( 1 ) =9 . 

BPOS (2)=2.+3.5 
CALL JOPEN 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

CALL CKEYPL ( ISTORE , KEYCHR , 1 M ( BLC ] ULTIPLE AXIS', 

+ ' D[BLC]ATA TYPE' ,BPOS, 5, JCOL, 1 ) 

CALL JCLOSE 


TERMINATE GRAPHICS 

CALL JPAUSE(IDEV) 

CALL JFRAME 

CALL JDEVOF(IDEV) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


3-58 



Computations vs Experiments 



Multiple axis 

Data type 

O Experimental 

■ Actual 


Figure 3-22. Complete program with interior axes 



3.3.11.4 Line Charts with Disjoint Axes 


This subsection describes how to generate line charts with a disjoint set of axes. 
Note, disjoint axes are nc; publication quality . The crucial element consists of 
the placement of the axes in relationship to one another and the data space 
(i.e., placement of the viewport). First the user draws the axes, then offsets the 
viewport from the axes. The data will be plotted in the window, which in turn is 
mapped onto the viewport. 

The user is referred to previous sections for instructions on generating axes. 
The following example, however, illustrates the use of interior axes. See Figure 
3-23 for the resultant output. 

PROGRAM CDR16 

C 

C LINE CHART WITH DISJOINT AXES (BASED ON CDR6) 

C 

C THE KEY ELEMENTS INVOLVING DISJOINT AXES INCLUDE: 

C - THE POSITIONING OP THE AXES (SEE XOFF AND YOFF) , 

C - THE SETTING OF THE VIEWPORT TO MATCH THE DATA SPACE 
C (WHICH DIFFERS FROM THE AXES BOUNDARIES). 

C 

C ALLOCATE AND INITIALIZE DATA 

PARAMETER (MAXPTS=1 0, MAXSET=2 ) 

REAL X(MAXPTS) , Y(MAXPTS,MAXSET) 

DATA X/5. 5, 6. 0,6. 5, 7. 0,7. 5, 8. 0,8. 5, 9. 0,9. 5, 10./ 

DATA ( Y(KI , 1 ) ,KI=1 ,10) 

+ /.001 , .003, .0075, .004, .006, .008, .009, .005, .003, .002/ 

DATA (Y(KI,2) ,KI=1 ,10) 

+ /.001 5, .004, .007, .0045, .0065, .0078, .0085, .0055, .0032, .002/ 

C 

C WRITE TO THE DEVICE IDEV 
IDEV=0 
CALL CBEGIN 
CALL JBEGIN 
CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 



C ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC(9 • ,9 . ) 

CALL JWINDO(0. ,9. ,0. ,9. ) 

CALL JOPEN 

C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 

CALL JSIZE( .2, .2*1 .25) 

C POSITION STRING, AND SET JUSTIFICATION (CENTER, CENTER) 

CALL JMOVE ( 4 . 5 , 6 . 0 ) 

CALL J JUST (2, 2) 


3-60 



o o o o non 


C OUTPUT THE STRING 

CALL JHSTRG( ‘A T[BLC] ITLE' ) 

C RESET THE CHARACTER SIZE FOR THE AXES 
CALL JSIZE( .1 , .1 *1 .25) 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
C XOFF - THE DISTANCE TO SHIFT THE X-AXIS DOWN. 

XOFF= . 2 

CALL JMOVE ( 2 . , 2 . - ( XOFF ) ) 

C DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB( 'HtBLClORIZONTAL [BUC)A[BLC)XIS' , 1 ) 

CALL CHAXIS (5.,10.,1.,4.) 

C DESCRIBE THE VERTICAL AXIS 

CALL CVLAB( ' V[ BLC] ERTICAL [BUC] A[BLC]XIS' , 1 ) 

CALL CVPREC ( 3 ) 

C YOFF - THE DISTANCE TO SHIFT THE Y-AXIS LEFT. 

YOFF=.2 

CALL JMOVE (2. -YOFF, 2. ) 

CALL CVAXIS( .0, .01 , .001 ,3.5) 

C SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 

C NOTE: THE VIRTUAL COORDINATES ARE BASED ON DIMENSIONS OF DATA 
C SPACE, NOT ON AXIS BOUNDARIES. 

CALL JCONWV( 2. ,2. ,0. ,VX1 ,VY1 ) 

CALL JCONWV (2. +4. ,2. +3. 5,0. , VX2 , VY2) 

C CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES) 

CALL JCLOSE 


SET WINDOW TO MATCH DATA COORDINATES, AND PLOT WITHIN BOUNDARIES 
OF THE AXES (BY SAVED VIRTUAL COORDINATES) 

CALL JWINDO(5. ,10. , .0, .Cl ) 

CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 

PLOT FIRST DATA CURVE USING CGL DEFAULTS 
CALL CSYMNO( 1 ) 

CALL CLNPATO ) 

CALL CLNPLT( X, Y( 1 , 1 ) ,MAXPTS) 

SET SYMBOL NUMBER TO 2, AND PLOT SECOND DATA CURVE 
CALL CSYMNO( 2) 

CALL CLNPAT ( 2 ) 

CALL CLNPLT ( X , Y ( 1 , 2 ) , MAXPTS ) 

CALL JCLOSE 


TERMINATE GRAPHICS 

CALL JPAUSE(IDEV) 

CALL JFRAME 

CALL JDEVOF ( IDEV ) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


3-61 



Vertical Axis 


A Title 


.010 

.009 

.008 

.007 

.006 

.005 

.004 

.003 

.002 

.001 

0 


5 


O 



6 7 8 9 10 


Horizontal Axis 


Figure 3-23. Complete program with disjoint axes. 


3-62 



3.4 Steps in the Generation of Bar Charts 


This section describes how to generate bar charts, both absolute and additive. 
In order to generate bar charts, the user must: 

- establish page coordinates 

- position, describe and draw components (i.e., axes, keys, etc.) 

- plot the data (using bars) 

3.4.1 Page Coordinates and Describing Components 

Since the setting up of page coordinates and the generation of chart 
components is identical to line charts, the user is referred to Section 3.2 for a 
complete explanation. After the page coordinates have been established, the 
components need to be positioned and described. As an example, the 
following partial code positions and describes a set of axes. Instead of a 
numeric axis, this chart could require a character horizontal axis with tick mark 
labels rotated at a 45 degree angle. 


• 

C NEXT, POSITION THE AXIS AND DESCRIBE ITS CONTENTS. 

CALL JMOVE (XORG, YORG) 

C NO HORIZONTAL AXIS LABEL 
CALL CHLAB ( ’ ',0) 

C SET HORIZONTAL TICK MARK LABELS ROTATION ANGLE 
CALL CHTROT (45) 

CALL CHAXIC (XLEN, NTICK+2 , HTLAB, l,NTICK+2) 

C HTLAB IS A CHARACTER ARRAY REPRESENTING MONTHS . 

C THE FIRST AND LAST ELEMENTS ARE BLANK TO ENSURE THE 
C DATA IS NOT PLOTTED ON THE AXES. 



CRUs (thousands) 


Now, define the vertical axes (in this example, a vertical axis on the left and right 
of the data area). 

• 

CALL CVLABC CRUS (THOUSANDS) 1) 

CALL CVAXIS (0 . , 10 . , 5 . , YLEN) 

CALL JMOVE (XORG+XLEN, YORG) 

CALL CVLABC ’,0) 

CALL CVJUST (0) 

CALL CVLABJ ( 1 ) 

CALL CVAXIS (0 10 5 YLEN) 


10 i-; 


10 


cfW cfW 


83 


84 


85 


Figure 3-24. Horizontal character axis with rotated tick mark labels. 


3-64 


c - 2 - 



3.4.2 Plotting Absolute Bar Chart Data 


When the data is absolute, each data set will have a bar depicting data at each 
horizontal tick mark. The user must ensure that the width of each bar must be 
small enough, such that data sets can be clearly distinguished between tick 
marks. Thus, the cumulative width of each tick mark's data set is 

(XMAX-XMIN)/REAL(NTICK-1 ) 

where 

XMAX-XMIN - represents the length of the axis in terms of the current 
world coordinate system; 

NTICK-1 - represents the number of intervals on the axis. 

This would leave a gap before the first tick mark, and after the last tick mark. 
However, the bars of each tick mark will abut against the bars of another. Thus, 
we must reduce the width by a reasonable factor (e.g., 2./3.). 

( (XMAX-XMIN) /REAL (NTICK-1) ) * (2 . /3 . ) 

The width of each data set’s bars on a single tick mark would be 

XWID= ( (XMAX-XMIN) /REAL (NTICK-1) ) * (2 . /3 . ) 

divided by the number of data sets (i.e., number of bars per tick mark) 

XBARW=XWID/REAL (NUMSET) 

Finally, to plot the data sets we merely setup a loop and perform the appropriate 
moves and rectangle calls. 

• 

DO 2 1=1, NUMSET 

CALL JPIDEX (1,48-1) ) 

C XOFF - OFFSET OF THE DATA SET PER TICK MARK ON THE AXIS 

XOFF=-XWID/2 . + REAL ( I- 1 ) *XBARW 
DO 2 J=1 , NUMPTS 

2 CALL JRECT (REAL ( J) +XOFF, 0.0, 

+ REAL ( J) +XOFF +XBARW, Y ( I, J) ) 

• 


3-65 



3.4.3 Complete Program Plotting Multiple Absolute Bar Chart Data Sets 


This section combines the steps presented in Section 3.4.2 into a complete 
program. This program demonstrates a bar chart with multiple absolute data 
sets. 


PROGRAM CDB2 

C 

C ABSOLUTE BARS - MULTIPLE DATA SETS 

C 

C SET UP PLOT CONSTANTS 

PARAMETER (XWMAX=1 1 .0 , YWMAX*1 1 .0, CSIZE*. 1 5 ) 
PARAMETER (XBEG=1 .5,YBEG=1 . 5 , XLEN=8 .5 , YLEN-5 . 0 ) 

C 

C ALLOCATE STORAGE AND INITIALIZE VARIABLES 
PARAMETER ( NUMSET=3 , NUMPTS=20 ) 

REAL REVCRU ( NUMS ET , NUMPTS ) 

CHARACTER MONTHS ( 0 ; 3 7 ) * 3 , VALUES ( 3 ) * 2 


DATA MONTHS/* 

’ , * JAN * 


•FEB' 

9 

•MAR’ 

9 

'APR' 

9 

'MAY* 

, 'JUN' 

9 

+ 

* JUL* 


'AUG' 

9 

'SEP' 

9 

'OCT' 

9 

'NOV' 

, ' DEC ' 

9 

+ 

* JAN 1 


'FEB' 

* 

'MAR' 

9 

'APR' 

r 

'MAY' 

, 'JUN' 

9 

+ 

1 JLJL 1 


'AUG' 

f 

'SEP' 

9 

'OCT' 

9 

'NOV' 

, 'DEC* 

9 

+ 

* JAN* 


•FEB' 

9 

'MAR' 

9 

•APR' 

9 

'MAY' 

, 'JUN' 

9 

+ 

*JUL* 


•AUG' 

9 

'SEP' 

9 

'OCT' 

9 

'NOV* 

, 'DEC' 

» 

9 


DATA VALUES/' O' , ' 5', '10'/ 

DO 9 1=1 , NUMSET 
DO 9 J=1, NUMPTS 
9 REVCRU ( I , J ) =RANF ( ) * 1 0 . 

C 

C INITIALIZE DI3000 AND CGL 
CALL JBEGIN 
CALL CBEGIN 
IDEV=0 

CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 

C 

C SET WINDOW AND VIEWPORT FOR PAGE AREA 
CALL CVSPAC ( XWMAX , YWMAX ) 

CALL JWINDOtO. , XWMAX, 0. , YWMAX) 

CALL JOPEN 

C 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

C HORIZONTAL AXIS 

CALL JMOVE ( XBEG , YBEG ) 

CALL CHTROT( 45 ) 

IMONTH1 =8 

CALL CHAXIC(XLEN,NUMPTS+2,MONTHS(IMONTH1-1) ,1 .NUMPTS+2) 


3-66 



o o o o no 


C YEARS 

XINCR=XLEN/REAL(NUMPTS+2-1 ) 

CALL JMOVE( XBEG,YBEG-( (CSIZE*1 . 25 ) + ( 3 . *CSIZE) +(CSIZE*1 .25) ) ) 
CALL JJUST( 2 , 3 ) 

CALL JHSTRG( *83' ) 

IF( IMONTH1 .NE.1 )THEN 

DIST=REAL( ( 1 2-IM0NTH1 )+2) 

CALL JRM0VE(DIST*XINCR,0. ) 

CALL JHSTRG( 1 84 * ) 

ENDIF 

CALL JRMOVEO 2.*XINCR,0. ) 

CALL JHSTRG( '85' ) 

C 

C VERTICAL AXIS - ON LEFT 

CALL JMOVE ( XBEG , YBEG ) 

CALL CVL AB ( ' CRU l BLC ] S UBLC] THOUSANDS )', 1 ) 

CALL CVAXIC( YLEN , 2 , VALUES ,1,1) 

C VERTICAL AXIS - ON RIGHT 

CALL JMOVE ( XBEG+XLEN, YBEG) 

CALL CVLAB( ' ' , 0) 

CALL CVJUST(O) 

CALL CVLABJ ( 1 ) 

CALL CVAXIC(YLEN, 2, VALUES, 1 ,0) 


DRAW MI SC. TEXT OVER PLOT 

YOFF= ( 2 • ‘CSIZE+5 . *CSIZE) 

CALL JMOVE (XBEG+XLEN/ 2. ,YBEG+YLEN+YOFF) 

CALL JJUST( 2 , 1 ) 

CALL JSIZE(1 . 5*CSIZE, 1 .5*CSIZE*1 .25) 

CALL JHSTRG( 'REVENUE CRUS') 

CALL JRMOVE(0. ,-2.*CSIZE*1 .25) 

CALL JHSTRG( 'DAILY AVERAGE - MONTHLY BY MACHINE') 
CALL JMOVE ( XBEG+CSIZE, YBEG+YLEN) 

CALL JJUST(1 , 3) 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

CALL JHSTRG('CY 175') 


SAVE OFF VIRTUAL COORDINATES OF DATA AREA (FROM AXES) 
CALL JCONWV (XBEG, YBEG, 0. , XVI ,YV1 ) 

CALL JCONWV ( XBEG+XLEN , YBEG+ YLEN, 0. ,XV2,YV2) 

CALL JCLOSE 


SET WINDOW AND VIEWPORT FOR DATA AREA 
CALL JVPORT ( XVI , XV2 , YV1 , YV2 ) 

CALL JWINDO(0. ,REAL(NUMPTS+1 ) ,0. , 10. ) 
C OPEN SEGMENT, AND PLOT BARS 
CALL JOPEN 
CALL JPINTR ( 1 ) 


3-67 


CRUs (thousands) 


C THE WIDTH OF BARS AT A SINGLE TICK MARK IS DETERMINED 
C BY THE LENGTH OF THE AXIS (IN DATA COORDINATES) DIVIDED 
C BY THE NUMBER OF INTERVALS TIMES A FRACTION (2/3). 

C XWIDTH=( (NUMPTS+1 ) /REAL(NUMPTS+2- 1 ))*(2./3. ) 

C NOTE IF THE WORLD IS FROM 0 TO A VALUE, THEN XWIDTH=2/3. 
XWIDTH= 2./3. 

XBARW =* XW IDTH /REAL ( NUMSET ) 

DO 2 1*1, NUMSET 

CALL JPIDEX( I , 48-1 ) 

XOFF=-XWIDTH/2. + REAL (1-1 ) * XBARW 
DO 2 J=1 , NUMPTS 

2 CALL JRECT(REAL( J)+XOFF,0. ,REAL( J)+XOFF+XBARW,REVCRU( I, J) ) 

C 

C TERMINATE DI3000 AND CGL 
CALL JCLOSE 
CALL J FRAME 
CALL JDEVOF ( IDEV ) 

CALL JDEND(IDEV) 

CALL JEND 
STOP 

END REVENUE CRUS 

DAILY AVERAGE - MONTHLY BY MACHINE 



83 84 85 


Figure 3-25. Bar chart with multiple absolute data sets. 


3-68 


3.4.4 Plotting Additive Bar Chart Data 


With additive data sets, the data from subsequent data sets are stacked (or 
accumulated) per tick mark. For example, Figure 3-26 shows three data sets 
represented in an additive fashion. The last two data sets are stacked on each 
other, on top of the first data set. 

The establishment of the axis is the same as in Subsection 3.4.1 , noting that the 
vertical axis bounds must represent the largest additive tick mark values. The 
following code will determine the bar widths, and plot the data in additive 
fashion. The accumulative width is computed as in the previous section as 

XWID= ( (XMAX-XMIN) /REAL (NTICK-1) ) * (2 ./3 . ) 

and the midpoint of XWID is calculated as 

XHALF =XWI D / 2 . 

Thus, the remaining difference between plotting additive versus absolute is 
illustrated by the following partial program. 


• 

C KEEP A RUNNING ACCUMULATION FOR EACH TICK MARK 
DO 1 1=1, NUMPTS 
1 TOTAL (I) =0.0 

C FOR THE NUMBER OF DATA SETS (NUMSET) DO 
DO 2 1=1, NUMSET 
C SET THE INTERIOR FILL 

CALL JPIDEX(I, 48-1) 

C FOR THE NUMBER OF DATA VALUES (NUMPTS) DO 
DO 2 J=l, NUMPTS 
C PLOT THE DATA AS BARS 

CALL JRECT (REAL (J) -XHALF, TOTAL (J) , 

* REAL (JJ+XHALF, TOTAL (J)+Y( I, J) ) 

C ACCUMULATE THE DATA 

2 TOTAL (J) -TOTAL (J)+Y (I, J) 



I 


I 


3.4.5 Complete Program Plotting Multi ple Additive Bar Chart Data . Se l S 

The following is a complete program using the method described Section 3.4.4 
to generate bar charts with multiple additive data sets. Figure 3-26 shows the 
graphics output generated by the following program. 


PROGRAM CDB3 


C 

C ADDITIVE BARS - MULTIPLE DATA SETS 

C 

c SET UP PLOT CONSTANTS 

PARAMETER! XV) MAX =1 1 ,0,YWMAX=1 1 ,0,CSIZE=.1 5) 
PARAMETER (XBEG=1 ,5,YBEG=1 . 5 , XLEN=8 . 5 , YLEN=5 . 0 ) 


C 

C ALLOCATE STORAGE AND INITIALIZE VARIABLES 
PARAMETER! NUMSET=3,NUMPTS=20) 

REAL REVCRU ( NUMSET , NUMPTS ) , TOTAL ( NUMPTS ) 
CHARACTER MONTHS ( 0: 37 ) *3 


DATA MONTHS/* 

' , 'JAN' 

+ 

'JUL' 

+ 

'JAN' 

+ 

'JUL' 

+ 

'JAN' 

+ 

DO 9 1=1, NUMSET 
DO 9 J=1 , NUMPTS 

'JUL' 


9 REVCRU ( I , J ) =RANF ( ) * 1 0 . 

C 

C INITIALIZE DI3000 AND CGL 
CALL JBEGIN 
CALL CBEGIN 
IDEV=0 

CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 


'FEB' , 'MAR' , 'APR' , 'MAY' , 'JUN' , 
'AUG', 'SEP', 'OCT', 'NOV', 'DEC', 
'FEB' , 'MAR' , 'APR', 'MAY' , 'JUN' , 
'AUG' , 'SEP' , 'OCT' , 'NOV' , 'DEC' , 
'FEB' , 'MAR' , 'APR' , 'MAY' , 'JUN' , 
'AUG' , 'SEP' , 'OCT* , 'NOV' , 'DEC' , ’ 


C 

C SET WINDOW AND VIEWPORT FOR PAGE AREA 
CALL CVSPAC! XWMAX , YWMAX) 

CALL JWIND0(0. , XWMAX, 0., YWMAX) 
CALL JOPEN 


C 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

C HORIZONTAL AXIS 

CALL JMOVE ( XBEG , YBEG ) 

CALL CHTROT! 45 ) 

IMONTH1 =8 

CALL CHAXIC! XLEN, NUMPTS+2 , MONTHS ( IMONTH1 -1 ) ,1 ,NUMPTS+2) 


V 


3-70 



on oo oo o oo 


C YEARS 

XINCR=XLEN/REAL(NUMPTS+2-1 ) 

CALL JM0VE(XBEG,YBEG-((CSIZE*1 . 25 ) + ( 3. *CSIZE)+(CSIZE*1 .25) ) ) 
CALL J JUST (2, 3) 

CALL JHSTRG( '83' ) 

IF( IM0NTH1 .NE.1 )THEN 

DIST=REAL( ( 1 2-IMONTH1 ) +2) 

CALL JRMOVE(DIST*XINCR,0. ) 

CALL JHSTRG( *84' ) 

ENDIF 

CALL JRMOVE (12. *XINCR , 0 . ) 

CALL JHSTRG( ’85' ) 


VERTICAL AXIS - LABEL ON LEFT OF AXIS 
CALL JMOVE(XBEG,YBEG) 

CALL CVLAB ( ' CRU [ 8LC ] S ([ BLC] THOUSANDS ) M ) 
CALL CVAXIS(0 . , 30. , 5 • , YLEN ) 

VERTICAL AXIS - LABEL ON RIGHT OF AXIS 
CALL JMOVE ( XBEG+XLEN , YBEG ) 

CALL CVLAB ( 1 ’ ,0) 

CALL CVJUST(O) 

CALL CVLABJ ( 1 ) 

CALL CVAXIS(0. ,30. ,5. ,YLEN) 


DRAW MISC. TEXT OVER PLOT 

YOFF= ( 2 . +CSIZE+5 . *CSIZE) 

CALL JMOVE ( XBEG+XLEN/2 . , YBEG+YLEN+YOFF ) 

CALL J JUST (2,1) 

CALL JSIZEO .5*CSIZE, 1 ,5*CSIZE*1 .25) 

CALL JHSTRG( 'REVENUE CRUS') 

CALL JRMOVE(0. ,-2.*CSIZE*1 .25) 

CALL JHSTRG( 'DAILY AVERAGE - MONTHLY BY MACHINE') 
CALL JMOVE(XBEG+CSIZE, YBEG+YLEN) 

CALL JJUST(1 ,3) 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

CALL JHSTRG ( ' CY 175') 


SAVE OFF VIRTUAL COORDINATES OF DATA AREA (FROM AXES) 
CALL JCONWV (XBEG, YBEG, 0., XVI ,YV1) 

CALL JCONWV ( XBEG+XLEN , YBEG+YLEN , 0 . , XV2 , YV2 ) 

CALL JCLOSE 


SET WINDOW AND VIEWPORT FOR DATA AREA 
CALL JVPORT(XV1 ,XV2,YV1 ,YV2) 

CALL JWINDO ( 0 . , REAL ( NUMPTS+ 1 ) , 0 . , 30 . ) 


3-71 


o o 


C OPEN SEGMENT, AND PLOT BARS 
CALL JOPEN 
CALL JPINTRO ) 

C THE WIDTH OF BARS AT A SINGLE TICK MARK IS DETERMINED 
C BY THE LENGTH OF THE AXIS (IN DATA COORDINATES) DIVIDED 
C BY THE NUMBER OF INTERVALS TIMES A FRACTION (2/3). 

C XWIDTH=( (NUMPTS+1 ) /REAL(NUMPTS+2- 1 ) )*(2./3.) 

C NOTE IF THE WORLD IS FROM 0 TO A VALUE, THEN XWIDTH=2/3. 
XWIDTH= 2./3. 

XHALF=XWIDTH/2 . 

DO 99 1=1 , NUMPTS 
99 TOTAL ( I) =0 . 0 

DO 2 1=1 , NUMSET 

CALL JPIDEXt I ,48-1 ) 

DO 2 J=1 , NUMPTS 

CALL JRECT(REAL( J)-XHALF ,TOTAL( J) , 

+ REAL(J)+XHALF,TOTAL(J)+REVCRU(I,J) ) 

2 TOTAL ( J ) =TOTAL( J ) +REVCRU ( I , J ) 


TERMINATE DI3000 AND CGL 
CALL JCLOSE 
CALL J FRAME 
CALL JDEVOF(IDEV) 
CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


3-72 



REVENUE CRUS 

DAILY AVERAGE - MONTHLY BY MACHINE 



Figure 3-26. Complete additive bar chart. 


3-73 


3.4.6 Plotting Both Absolute and Additive Bar Chart D ata 


Before attempting this section, it is recommended that Sections 3.4.2 and 3.4.4 
are read on plotting absolute and additive data sets onto separate charts. The 
following section explains how to combine the two types onto one chart. There 
are two steps that should be taken before writing a program. 

Step 1 : Know the number of data sets. The number of absolute data sets is 
very important because it directly affects the bar width and the spacing between 
each tick mark. In this example, there are a total of three data sets, two of which 
are absolute data sets. 

Step 2: Know how to combine the data sets. The first data set will always be 
plotted as an absolute bar graph because there is no preceding data. The type 
of the subsequent data sets to be plotted must be indicated by the user as being 
additive or absolute (i.e., see ID below). In this example, the second data set 
will be plotted as an additive bar, while the third will be plotted as an absolute 
bar. 


C Allocate storage and initialize variables. 

PARAMETER (NUMSET=3 , NUMPTS=20 ) 

INTEGER ID (NUMSET) 

REAL RE VCRU (NUMSET, NUMPTS) , TOTAL (NUMPTS) 
DATA ID/0,1,0/ 

C ID[1] = 0 means an absolute data set 

C ID [2] = 1 means an additive data set 

C ID [3] = 0 means an absolute data set 


C Determine the number of additive data sets. 

ICT=0 

DO 101 1=2, NUMSET 

101 IF (ID (I) .EQ. 1) ICT=ICT+1 

C Note: NUMSET-ICT equals the number of absolute data sets. 
C Open segment and plot bars . 

CALL JOPEN 
CALL JPINTR(l) 


3-74 



C The width of the bars at a single tick mark is determined 
C by the length of the axis (in data coordinates) divided by 
C the number of absolute data sets , times (2./3.) . 

C XWIDTH = ( (NUMPTS+1) / REAL (NUMPTS+2-1 ) ) * <2./3.) 

C NOTE: If the world is from 0 to a value (with an increment 
C of 1, as is typical for bar charts), then XWIDTH = 2./3. 

C Each bar width (XBARW) is the XWIDTH divided by the number 
C of absolute data sets. 

XWIDTH=2 . /3 . 

XBARW=XWIDTH/REAL (NUMSET-ICT) 

DO 99 1=1 , NUMPTS 
99 TOTAL (I) =0.0 


C ICT is the current absolute data set counter, and 
C determines the offset (based on which absolute data set) . 

ICT=1 

DO 2 1=1 , NUMSET 

CALL JPIDEX(I, 48-1) 

XOFF=-XWIDTH/2 . + REAL ( ICT- 1 ) *XBARW 

C If ID[i]=l (absolute data set), then increment ICT counter. 

IF (ID (I) .EQ. 1) ICT=ICT+1 
DO 2 J=l, NUMPTS 

DO JRECT (REAL ( J) +XOFF, TOTAL (J) , REAL ( J) +XOFF +XBARW, 

+ TOTAL ( J) +REVCRU ( I , J) ) 


C Check to see if lD[i+l] = 1 (i.e., an additive data set), 
C then accumulate TOTAL. 

IF ( ID ( 1 + 1 ) . EQ . 1) THEN 

TOTAL ( J ) =TOTAL ( J ) +REVCRU (I, J) 

ELSE 

TOTAL (J)=0. 

ENDIF 

2 CONTINUE 

CALL JCLOSE 

• 


Figure 3-27. Partial program with absolute and additive data sets. 


3-75 


3.4.7 Qnmnleta Program Plottino Multiple Abso lute and Additive Bar Chart Data 
Sets 

The following program shows how to generate a bar chart with multiple 
absolute and additive data sets. This program combines the steps presented in 
the last section in context. The resultant graphical output is found in Figure 
3-27. PROGRAM CDB1 



C ADDITIVE AND ABSOLUTE BARS - MULTIPLE DATA SETS 

C 

C SET UP PLOT CONSTANTS 

PARAMETER (XWMAX=1 1 .0,YWMAX=1 1 .0,CSIZE=.1 5) 

PARAMETER (XBEG=1 .5,YBEG=1 . 5 , XLEN=8 . 5 , YLEN=5 .0 ) 

C 

C ALLOCATE STORAGE AND INITIALIZE VARIABLES 
PARAMETER (NUMSET= 3 ,NUMPTS=20) 

INTEGER ID(NUMSET) 

REAL REVCRU ( NUMSET , NUMPTS ) , TOTAL ( NUMPTS ) 

CHARACTER MONTHS ( 0: 37 ) *3 
DATA ID/0,1,0/ 

DATA MONTHS/' ' , ’ JAN' , ' FEB' , ' MAR' , ’ APR' , 'MAY' , ' JUN' , 

+ 'JUL', 'AUG' , 'SEP' , 'OCT* , 'NOV* , 'DEC', 

+ 'JAN' , 'FEB' , 'MAR' , 'APR* , 'MAY* , 'JUN' , 

+ 'JUL' , 'AUG' , 'SEP' , 'OCT' , 'NOV' , 'DEC* , 

+ 'JAN' , ' FEB' , 'MAR' , 'APR* , 'MAY* , 'JUN* , 

+ 'JUL' , 'AUG' , 'SEP' , 'OCT' , 'NOV* , 'DEC* , ' ' / 

DO 9 1=1, NUMSET 
DO 9 J=1, NUMPTS 
9 REVCRU ( I , J ) =RANF ( ) * 1 0 . 

C 

C INITIALIZE DI3000 AND CGL 
CALL JBEGIN 
CALL CBEGIN 
IDEV=0 

CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 

C 

C SET WINDOW AND VIEWPORT FOR PAGE AREA 
CALL CVSPAC( XWMAX,YWMAX) 

CALL JWINDO ( 0 . , XWMAX , 0 , , YWMAX ) 

CALL JOPEN 

C 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

C HORIZONTAL AXIS 

CALL JMOVE(XBEG, YBEG) 

CALL CHTROT( 45 ) 

IMONTH1 =8 

CALL CHAXIC(XLEN,NUMPTS+2,MONTHS( IMONTH1 -1 ) ,1 ,NUMPTS+2) 

3-76 



no on on on 


C YEARS 

XINCR=XLEN/REAL (NUMPTS+2-1 ) 

CALL JMOVE( XBEG , YBEG- ( (CSIZE*1 .25)+( 3. *CSIZE)+(CSIZE*1 ,25) ) ) 
CALL JJUSTt 2,3) 

CALL JHSTRGt '83' ) 

IF( IM0NTH1 .NE.1 )THEN 

DIST=REAL( (12-IM0NTH1 )+2) 

CALL JRMOVE(DIST*XINCR,0.) 

CALL JHSTRG( '84' ) 

ENDIF 

CALL JRMOVEt 1 2.*XINCR,0. ) 

CALL JHSTRGt '85' ) 


VERTICAL AXIS - ON LEFT OF PLOT 
CALL JMOVEt XBEG, YBEG) 

CALL CVLABt 'CRUlBLCjS ( l BLC] THOUSANDS) 1 ) 
ICT=0 

DO 101 1=2 ,NUMSET 
II IF (ID(I).EQ.I) ICT=ICT+1 

VMAX= 1 0 . * REAL ( NUMS ET-ICT ) 

CALL CVAXIStO, ,VMAX,5» , YLEN) 

VERTICAL AXIS - ON RIGHT OF PLOT 
CALL JMOVEt XBEG+XLEN, YBEG) 

CALL CVLABt ’ ' ,0) 

CALL CVJUST(O) 

CALL CVLABJ ( 1 ) 

CALL CVAXIStO. ,VMAX,5. , YLEN) 


DRAW MISC. TEXT OVER PLOT 

YOFF=(2.*CSIZE+5.*CSIZE) 

CALL JMOVEt XBEG+XLEN/2 , , YBEG+YLEN+YOFF) 

CALL JJUSTt 2 , 1 ) 

CALL JSIZEtl .5*CSIZE,1 .5*CSIZE*1 .25) 

CALL JHSTRGt ’REVENUE CRUS') 

CALL JRMOVE ( 0 . , - 2 . *CS IZE* 1 .25) 

CALL JHSTRGt 'DAILY AVERAGE - MONTHLY BY MACHINE') 
CALL JMOVEt XBEG+CSIZE,YBEG+YLEN) 

CALL JJUSTt 1 ,3) 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

CALL JHSTRGt 'CY 175') 


SAVE OFF VIRTUAL COORDINATES OF DATA AREA (FROM AXES) 
CALL JCONWV (XBEG, YBEG, 0., XVI ,YV1 ) 

CALL JCONWV (XBEG+XLEN,YBEG+ YLEN, 0. ,XV2,YV2) 

CALL JCLOSE 


SET WINDOW AND VIEWPORT FOR DATA AREA 
CALL JVPORTt XVI , XV2 , YV1 , YV2) 

CALL JWINDOtO. ,REAL(NUMPTS+1 ),0.,VMAX) 


3-77 


n n N> 


C OPEN SEGMENT, AND PLOT BARS 
CALL JOPEN 
CALL JP INTRO ) 

C THE WIDTH OF BARS AT A SINGLE TICK MARK IS DETERMINED 
C BY THE LENGTH OF THE AXIS (IN DATA COORDINATES) DIVIDED 
C BY THE NUMBER OF INTERVALS TIMES A FRACTION (2/3). 

C XWIDTH=( (NUMPTS+1 )/REAL(NUMPTS+2-1 ) )*(2./3. ) 

C NOTE IF THE WORLD IS FROM 0 TO A VALUE, THEN XWIDTH=2/3. 
XWIDTH= 2./3. 

XBARW=XWIDTH/REAL ( NUMSET-ICT ) 

DO 99 1=1 ,NUMPTS 
99 TOTAL(I)=0.0 

ICT=1 

DO 2 1=1 , NUMSET 

CALL JPIDEX( I , 48-1 ) 

XOFF=-XWIDTH/2. + REAL( ICT-1 ) *XBARW 
IF(ID(I) .EQ.1 )ICT=ICT+1 
DO 2 J=1 , NUMPTS 

CALL JR EOT ( REAL ( J ) +XOFF , TOTAL ( J ) , REAL( J) +XOFF+XBARW, 
+ TOTAL ( J ) +REVCRU ( I , J ) ) 

IF (ID( 1+1). EQ.1) THEN 

TOTAL ( J ) =TOTAL ( J ) +REVCRU (I, J) 

ELSE 

TOTAL ( J ) =0 . 

END IF 
CONTINUE 


TERMINATE DI3000 AND CGL 
CALL JCLOSE 
CALL J FRAME 
CALL JDEVOF ( IDEV ) 
CALL JD END (IDEV) 

CALL JEND 

STOP 

END 


3-78 




83 84 85 


Figure 3-28. Complete program with absolute and additive data sets. 

3-79 


3.4.8 Adding a Kev to Bar Charts 


The necessary steps to generate a bar chart with multiple data sets has been 
demonstrated. The next evolutionary step is the addition of a key. A key is a list 
of words or phrases giving an explanation of symbols or abbreviations (Figure 
2-4 indicates a key in a XY line chart). 

In order to add a key, the following four steps are necessary: 

1) declare and allocate key related variables; 

2) initialize the key related variables by calling CKEYIN; 

3) for each data set to be represented in the key, call CKEYLB. This call 
should be performed when the data is to be drawn, since this routine will 
save off various DI-3000 and CGL attributes currently active; and 

4) finally to plot the key, call CKEYPL. This call should be performed in 
page coordinates. Thus, the window and viewport may have to be reset. 

Step 1 - Declare and allocate variables 

A key is a series of entries (lines), where each entry is stored internally as a 
collection of attributes. The user is required to declare and allocate storage for 
these attributes. Specifically, two variables are needed, ISTORE (storage array 
for attributes) and KEYCHR (storage array for line labels). The dimensions of 
these arrays should be large enough to accommodate the largest number of 
data sets plotted at one time. See the description of the routine CKEYPL in 
Appendix A for a more detailed description. 




c 

c 

c 

c 

c 


PARAMETER (NLINS=4 , NCOLS=l ) 

NLINS - the maximum number of lines in the key 
NCOLS - the number of columns for an entry 
*20 - the largest character string per entry 

(including mnemonics) 

(Note, in this example 20 is used, could be any value.) 


CHARACTER KEYCHR (NCOLS, NLINS) * 9 
INTEGER ISTORE (15, NLINS) 


3-80 



o o o n o 


Step 2 - Initialize the key related variables by calling CKEYIN. This initialization 
can be performed anywhere, at anytime (i.e., the variables passed to CKEYIN 
will be reset). 


C Set window to match data coordinates, and plot within 
C boundaries of the axes 

CALL JWINDO ( 0 . , REAL (NUMPTS+1) , 0 . , 10 . ) 

0 ., REAL (NUMPTS+1) - the data coordinate boundaries in the 

X-direction. Set 1 to NUMPTS, plus an 
extra point on each end of the scale. 
0.,10. - the data coordinate boundaries in the 

Y-direction 

CALL JVPORT ( VX1 , VX2 , VY1, VY2 ) 

CALL JOPEN 

CALL CKEYIN (ISTORE, KEYCHR, NLINS, NCOLS, NTLINS) 


Step 3 - For each data set to be represented in the key, call CKEYLB. This call 
should be performed when the data is to be drawn, since this routine 
will save off various DI-3000 and CGL attributes currently active. The 
key related variables will be assigned values to be plotted when all 
the key entries have been obtained. This typically requires the 
plotting of the data (in terms of data coordinates). Note, a "-4" is 
passed to CKEYLB to indicate a rectangle (instead of a line) is to be 
used in the key. 


C Plot the first data set 
DO 2 1=1 , NUMSET 

CALL JPIDEX(I, 48-1) 

CALL CKEYLB (ISTORE, KEYCHR, -4, KEYLAB ( I) ) 

DO 2 J-l, NUMPTS 

CALL JRECT (REAL ( J) -XHALF, TOTAL ( J) , 

+ REAL (J) +XHALF, TOTAL (J) +REVCRU ( I, J) ) 

2 TOTAL ( J) =TOTAL (J) +REVCRU (I, J) 

CALL JCLOSE 

• 


3-81 



Step 4 - Finally to plot the key, call CKEYPL. When all the key entries have 
been made, a call to CKEYPL will plot the key based on the attributes stored in 
ISTORE and KEYCHR (and a few internal variables). The call to CKEYPL 
should be performed in page coordinates, and since most data is plotted in data 
coordinates (where the attributes are saved by CKEYLB), the window and 
viewport will probably have to be reset. 




c 

c 


Now output the key 

Set the window and viewport for page coordinates 


CALL JVPORT (...) 

CALL JWINDO (...) 

BPOS ( 1 ) =XORG+XLEN 
BPOS ( 2 ) =YORG+YLEN 
CALL JOPEN 

CALL JSIZE (0.1, 0.1*1. 25) 

CALL CKEYPL (ISTORE, KEYCHR, 'K[BLC]EY TITLE', 
+ ' C [BLC] OLUMN TITLE ', BPOS, 5, JCOL, 1) 

CALL JCLOSE 


C Terminate graphics 
CALL JPAUSE ( IDEV) 
CALL JFRAME 
CALL JDEVOF (IDEV) 
CALL JDEND (IDEV) 
CALL JEND 


« 


3-82 



3.4.9 Complete Bar Chart Program with a Kev 


The following program is used to demonstrate how to embed these four steps 
into a complete program. The key related statements have been additionally 
commented for clarity. Figure 3-29 shows the graphics output from the following 
program. 


PROGRAM CDB4 

C 

C ADDITIVE BARS - MULTIPLE DATA SETS, WITH A LEGEND. 



C SET UP PLOT CONSTANTS 

PARAMETER OCWMAX*1 1 .0,YWMAX=1 1 .0) 

PARAMETER ( XBEG*1 . 5 , YBEG=1 . 5 ) 

PARAMETER ( XLEN=8 . 5 , YLEN-5 . 0 ) 

PARAMETER (CS I ZE=.1 5) 



C ALLOCATE STORAGE AND INITIALIZE VARIABLES 
PARAMETER ( NUMSET*3 ,NUMPTS»20) 

REAL REVCRU ( NUMSET , NUMPTS ) , TOTAL ( NUMPTS ) 

PARAMETER (NLINES=4,NCOLS=1 ,NTLINES=1 ) 

CHARACTER KEYCHR(NCOLS ,NLINES) *9,KEYLAB(NLINES) *9 
INTEGER ISTOREt 1 5 ,NLINES ) , JCOL(1 ) 

REAL BPOS ( 4 ) 

CHARACTER MONTHS ( 1 2 ) *3 .VALUES ( 3 ) *2 

DATA MONTHS/' JAN' , 'FEB' 'MAR' , 'APR' , 'MAY' , 'JUN' , 

+ ' JUL' , 'AUG' , 'SEP' , 'OCT' , 'NOV' , 'DEC'/ 

DATA VALUES/' 0*,' 5', *10'/ 

DATA KEYLAB(1 ) /' -AVAIL+PM* /,KEYLAB( 2 ) / ' -AVAIL '/ 

DATA KEYLAB ( 3 ) / ' -USE ' /,KEYLAB( 4) / ' -PROD '/ 

DATA JCOL/1 / 

DO 9 1=1 , NUMSET 
DO 9 J=1 , NUMPTS 
9 REVCRU ( I , J ) =RANF ( ) * 3 . 



C INITIALIZE DI3000 AND CGL 
CALL JBEGIN 
CALL CBEGIN 
CALL CDEBUG( 1 ) 

IDEV=0 

CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 



C SET WINDOW AND VIEWPORT FOR PAGE AREA 
CALL JVSPAC(-1.,1.,-1.,1.) 

CALL JWINDO ( 0 . , XWMAX , 0 . , YWMAX ) 

CALL JOPEN 


3-83 


o o o o 


C 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

C HORIZONTAL AXIS 

CALL JMOVE ( XBEG , YBEG ) 

CALL CHLABJ { 1 ) 

CALL CHAXIC( XLEN, 2 , ' ' ,0,NUMPTS) 

C MONTHS 

XINCR=XLEN/REAL(NUMPTS+2-1 ) 

CALL JMOVE ( XBEG , YBEG- 2 . *CSI ZE* 1 .25) 

CALL JJUST( 3,2) 

CALL CSETBP(90. ) 

IMONTH1 =8 

DO 1 KI=1 ,NUMPTS 

IMONTH-KI+IMONTH1-1 

IMONTH=MOD ( IMONTH ,12) 

IF ( IMONTH . EQ. 0 ) IMONTH=1 2 
CALL JRMOVE(XINCR,0. ) 

1 CALL JHSTRG( MONTHS (IMONTH) ) 

CALL CSETBP( 0. ) 

CALL JSETDB(O) 

C YEARS 

CALL JMOVE (XBEG, YBEG- ( (CSIZE*1 .25)+(3.*CSIZE)+(CSIZE*1 .25))) 
CALL JJUST( 2,3) 

CALL CSETBP ( 0 . ) 

CALL JHSTRG( , 83' ) 

IF(IMONTH1 .NE. 1 )THEN 

DIST=REAL( ( 1 2-IMONTH1 ) +2) 

CALL JRMOVE(DIST*XINCR,0. ) 

CALL JHSTRGt '84' ) 

ENDIF 

CALL JRMOVE( 12. *XINCR, 0. ) 

CALL JHSTRG( '85' ) 


VERTICAL AXIS 

CALL JMOVE (XBEG, YBEG) 

CALL CVLAB ( ' CRU ( BLC ) S ( (BLCl THOUSANDS )', 1 ) 
CALL CVAXIC(YLEN, 3, VALUES, 1 ,3) 

CALL JMOVE (XBEG+XLEN, YBEG) 

CALL CVLAB ( ' ' ,0) 

CALL CVJUST ( 0 ) 

CALL CVLABJ ( 1 ) 

CALL CVTICJ ( 2 ) 

CALL CVAXIC(YLEN, 3, VALUES, 1 ,3) 


DRAW MI SC. TEXT OVER PLOT 

YOFF=( 2. ‘CSIZE+5. *CSIZE) 

CALL JMOVE ( XBEG+XLEN/2 . , YBEG+YLEN+YOFF ) 

CALL J JUST (2,1) 

CALL JSIZEO .5*CSIZE, 1 .5*CSIZE*1 .25) 

CALL JHSTRG( 'REVENUE CRUS* ) 

CALL JRMOVE(0. ,-2.*CSIZE*1 .25) 

CALL JHSTRG( 'DAILY AVERAGE - MONTHLY BY MACHINE' ) 

3-84 



ooo ooo ooooo 


CALL JMOVE ( XBEG+CSIZE, YBEG+YLEN ) 
CALL JJUST(1 ,3) 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

CALL JHSTRG( 'CY 175* ) 


SAVE OFF VIRTUAL COORDINATES OF DATA AREA (FROM AXES) 
CALL JCONWV (XBEG, YBEG,0. ,X1 , Y1 ) 

CALL JCONWV ( XBEG+XLEN , YBEG+ YLEN , 0 . , X2 , Y 2 ) 

CALL JCLOSE 


SET WINDOW AND VIEWPORT FOR DATA AREA 
CALL JVPORT(X1 ,X2,Y1 ,Y2) 

CALL JWINDO(0. ,REAL(NUMPTS+1 ) ,0. ,10. ) 

OPEN SEGMENT, AND PLOT BARS 
CALL JOPEN 

CALL CKEYIN ( ISTORE,KEYCHR, NLINES , NCOLS ,NTLINES ) 
CALL JPINTR( 1 ) 

XWIDTH=2./3. 

XHALF=XWIDTH/2. 

DO 99 1=1 , NUMPTS 
99 TOTAL ( I ) =0 . 0 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

DO 2 1=1 .NUMSET 

CALL JPIDEX(I,47-(I-1 ) ) 

CALL CKEYLB( ISTORE,KEYCHR,-4,KEYLAB( I ) ) 

DO 2 J=1 , NUMPTS 

CALL JRECT(REAL( J)-XHALF,TOTAL( J) , 

+ REAL ( J ) +XHALF , TOTAL ( J ) +REVCRU ( I , J ) ) 

2 TOTAL ( J ) =TOTAL ( J ) +REVCRU ( I , J ) 

CALL JCLOSE 


NOW OUTPUT LEGEND 

SET WINDOW AND VIEWPORT FOR PAGE AREA 
CALL JSETDB(O) 

CALL JVPORT(-1.,1 .,-.773,. 773) 

CALL JWINDO( 0. ,10. ,0.,7.73) 

BPOS ( 1 ) =XBEG+XLEN 
BPOS ( 2 ) =YBEG+YLEN 
CALL JOPEN 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

CALL CKLPLN ( .08 ) 

CALL CKEYPL(ISTORE,KEYCHR, ’ ' , BPOS , 3 , JCOL, 0 ) 

CALL JCLOSE 


TERMINATE DI3000 AND CGL 
CALL JPAUSE(IDEV) 
CALL JFRAME 
CALL JDEVOF ( IDEV ) 
CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


3-85 



— AVAiL+PM 

ZZZZZZZk -avail 

KSSS3 -USE 


REVENUE CRUS 

DAILY AVERAGE - MONTHLY BY MACHINE 


•9 

“O 

c 

o 

V) 

3 

o 

X 


*> 

q: 

o 



10 


Figure 3-29. Complete bar chart with a key. 


3-86 


3.5 Steps in the Generation of Pie Charts 


This section discusses how to generate pie charts. The Low-Level routines of 
the CGL contain hq routines for the generation of pie charts. This is because a 
pie chart consists of a set of sectors (possibly with associated text). Thus, the 
components of pie charts are so primitive, that little advantage can be obtained 
by calling any routines other than those supplied by the underlying graphics 
package. 

This section will describe a method of calling the underlying graphics package, 
and take advantage of some CGL routines to perform supplementary functions 
* (i.e., keys). The major steps in the generation of pie charts consists of: 

- setting page coordinates 

- determining the placement of the center of the pie 

- drawing the pie segments (possibly with segment labels) 

3.5.1 Paoe Coordinates and Describing Components 

A convenient approach to aid the user in designing a chart is to establish a 
coordinate system, referred to here as the paoe coordinate system, which easily 
enables the user to arrange and describe the chart components. The page 
coordinates can be of any dimension and represent any unit. Since 
publication-quality charts are often requested, the page coordinates described 
in the document are typically in terms of inches to coincide with the 
postprocessors (plotters). 

A call to JVSPAC will setup the viewspace and viewport. A call to JWINDO 
defines the viewing window. 

CALL JVSPAC (-1 . , 1 . , -1 . , 1 . ) 

» CALL JWINDO ( 0., 10. ,0., 10.) 

Once the page coordinates have been set, the user can position and describe 
objects in terms of the page coordinates. For example, the following code will 
output a graphics string as a title, output a graphics string in the bottom left hand 
corner of the page as well as the bottom right hand corner of the page (as 
shown in Figure 3-30). 


3-87 




C OPEN A TEMPORARY SEGMENT FOR BORDERS. 
CALL JOPEN 

CALL JIWIND(XV,YV,ZV) 

CALL JPIDEX(4,0) 

CALL JPOLGN ( XV , YV , 4 ) 

CALL JSIZE(.4,.4) 

CALL JFONT( 3 ) 

CALL JJOST( 2,2) 

CALL JMOVE ( 5 . ,9.2) 

CALL JHSTRG( 'MATERIALS' ) 

CALL JMOVE ( . 1 , .8) 

CALL JHSXTN ( YEAR,DX,DY ) 

CALL JPIDEX(6, 0) 

CALL JRRECT ( DX , D Y ) 

CALL JJUST( 1,1) 

CALL JHSTRG ( YEAR ) 

CALL JMOVE (9.9, .8) 

CALL JSIZE( .25, .25) 

CALL JFONT( 1 ) 

CALL JJUST(3, 1 ) 

CALL JHSTRG { 'PREPARED BY CSC') 

C 

C CLOSE THE TEMPORARY SEGMENT. 

CALL JCLOSE 



MATERIALS 


1 9881 


PREPARED BY CSC 


Figure 3-30. Example of page layout for a pie chart. 


3-89 



3.5.2 


Once the page coordinates have been established, the center of the pie must 
be decided and the pie segments drawn. In order to get a true circle for the pie, 
the program should ensure consistent aspect ratios for both the current viewport 
and current window in which the pie is drawn. 

In order to plot the data, the sectors of the pie must be plotted individually. To 
draw pie segments, the following pie characteristics (see Figure 3-31) must be 
supplied: 

- pie center (i.e., X, Y, 0.0) 

- pie radius (RADI) 

- number of pie segments (NUMSEG) 

- segment attributes (see JPIDEX) 

- segment angles (see variables AO and A1 of JSECTR) 

- segment text attributes (i.e., JSIZE, JFONT, JJUST, etc.) 

- segment text position (based on RADIUS and quadrant) 



Figure 3-31 . Variables associated with pie chart generation. 

3-91 


PRECEDING 


PAGE BLANK NOT FILMED 



no o o on 


The following is a partial program explaining the steps involved in plotting pie 
chart data. 


COMPUTE THE FACTOR FOR CONVERTING DEGREES TO RADIANS. 
DTORAD=ATAN (1.0) /45. 


TOTAL THE REGIONAL DATA. 
TOTAL=0 . 0 
DO 3000 1=1,8 

3000 TOTAL = TOTAL+REGION (I) 


OPEN A TEMPORARY SEGMENT FOR THE PIE CHART SECTORS AND LABELS. 

CALL JOPEN ► 

C THE FIRST PIE SEGMENT STARTS AT 0 . 0 DEGREES. 

START=0 . 

C SET THE TEXT ATTRIBUTES 
CALL US I ZE ( .2, .2) 

CALL JFONT(l) 

C LOOP FOR ALL PIE SEGMENTS (NUMSEG IS 8) 

DO 5000 1=1,8 

C COMPUTE BEGINNING AND ENDING ANGLES 
A0=START 

Al=REGION ( I ) /TOTAL*360 .+START 
START=A1 

C SET PIE SEGMENT ATTRIBUTES, AND DRAW SEGMENTS 
CALL JPIDEX (I, 1+30) 

CALL JSECTR(5 . , 5 . , 0 . ,RAD1, 0, A0, Al) 

C CALCULATE SEGMENT MIDPOINT, AND ASSOCIATED POSITION OF SEGMENT TEXT 
AMID= (A1-A0) /2 .+A0 
ARAD=AMID *DTORAD 
Cl=COS (ARAD) 

S1=SIN (ARAD) 

C MOVE AND DRAW A LINE FROM THE PIE SEGMENT TO THE TEXT 
CALL JMOVE (5 . +RAD2*C1, 5 . +RAD2*S1) 

CALL JDRAW (5 . +RAD3*C1, 5 .+RAD3*S1) 

C DETERMINE THE PIE SEGMENT TEXT JUSTIFICATION (BASED ON ANGLE) , 

IF (AMID .LT. 45. .OR. AMID .GE. 315.) CALL JJUST(1,2) 

IF (AMID .GT. 45. .AND. AMID .LT. 135.) CALL JJUST(2,1) 

IF (AMID .GE. 135. .AND. AMID . LT . 225.) CALL JJUST(3,2) 

IF (AMID .GE. 225. .AND. AMID .LT. 315.) CALL JJUST(2,3) 

C POSITION TEXT AND DRAW TEXT 

CALL JMOVE (5 . +RAD4*C1 , 5 . +RAD4*S1 ) 

5000 CALL JHSTRG (LABEL (I ) ) 

• 


3-92 



Figure 3-32. Plotting pie data. 


3-93 



3.5.3 Complete Program Plotting a Pie Chart 


The previous subsections walked through the steps and described a method of 
generating a pie chart. The following is a complete program using the method 
previously described in context. The corresponding graphics output can be 
found in Figure 3-33. 

PROGRAM CD PI 



C BASIC PIE CHART 



C INITIALIZE DATA 

REAL OFFSET, RADI ,RAD2,RAD3,RAD4 
REAL XV ( 4 ) , YV ( 4 ) , ZV ( 4 ) , REGION ( 8 ) 

CHARACTER*! 4 LABEL ( 8 ) 

CHARACTER*4 YEAR 



C INITIALIZE DATA 

DATA OFFSET, RAD! ,RAD2,RAD3,RAD4 /. 25 , 2 . , 2 . 35 , 2 . 85 , 2 .95/ 

DATA REGION (1 ) ,REGION( 2 ) , REGION( 3 ) , REGION ( 4 ) /2 1 . , 6 . , 24. , 28 ./ 
DATA REGION ( 5 ) ,REGION(6) , REGION (7 ) .REGION (8)/4.,13.,18.,32./ 

C 

DATA YEAR /'1988V 
C 

DATA LABEL (1 ) / ' N [BLC] ICKEL' / 

DATA LABEL ( 2 ) / 'M [ BLC] AGNESIUM 1 / 

DATA LABEL ( 3 ) / 1 A [ BLC ] LUMINUM 1 / 

DATA LABEL ( 4 ) / ' G [ BLC ] OLD ' / 

DATA LABEL(5)/'I[BLC]RON'/ 

DATA LABEL ( 6 ) / ' S [ BLC ] ILVER ' / 

DATA LABEL(7)/'C[BLC]OPPER'/ 

DATA LABEL ( 8 ) / ' L [ BLC ] EAD ' / 



C INITIALIZE DI-3000 
CALL JBEGIN 

C WRITE TO THE DEVICE IDEV 
IDEV=0 

CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 



C DEFINE THE VIEWSPACE AND WINDOW OF SAME ASPECT RATIO 
CALL JVS P AC (-1 .,1 .,-1 .,1 .) 

CALL JWINDO (0.,10.,0.,10.) 



C FILL POLYGONS BY DEFAULT. 

CALL JDPINT ( 1 ) 


3-94 



c 

C OPEN A TEMPORARY SEGMENT FOR BORDERS. 

CALL JOPEN 

CALL JI WIND ( XV , YV , ZV ) 

CALL JPIDEX(4,0) 

CALL JP 3LGN ( XV , YV , 4 ) 

CALL JSIZE(.4,.4) 

CALL JFONT( 3 ) 

CALL JJUST( 2,2) 

CALL JMOVE(5. ,9.2) 

CALL JHSTRG ( 'MATERIALS' ) 

CALL JMOVE ( .1 , .8) 

CALL JHSXTN ( YEAR , DX , DY ) 

CALL JPIDEX( 6,0) 

CALL JRRECT(DX,DY) 

CALL JJUST(1 ,1 ) 

CALL JHSTRG ( YEAR ) 

CALL JMOVE (9.9, .8) 

CALL JSIZE( .25, .25) 

CALL JFONT(I) 

CALL JJUST( 3,1 ) 

CALL JHSTRG (' PREPARED BY CSC') 

C 

C CLOSE THE TEMPORARY SEGMENT. 

CALL JCLOSE 

C 

C COMPUTE THE FACTOR FOR CONVERTING DEGREES TO RADIANS. 

DTORAD= ATAN ( 1 . 0 ) /4 5 . 

C 

C TOTAL THE REGIONAL DATA. 

TOTAL=0 .0 
DO 3000 1=1 ,8 

3000 TOTAL = TOTAL+REGION ( I ) 

C 

C OPEN A TEMPORARY SEGMENT FOR THE PIE CHART SECTORS AND LABELS. 
CALL JOPEN 
START=0. 

CALL JSIZE( .2, .2) 

CALL JFONT( 1 ) 

DO 5000 1=1 ,8 
A0=START 

A1 =REGION ( I ) /TOTAL* 3 60. +S TART 
START=A1 

CALL JPIDEX( 1,1+30) 

CALL JSECTR(5.,5.,0.,RAD1 ,0,A0,A1 ) 

C 


o o o o n n 


AMID=(A1-A0)/2.+A0 
ARAD=AMID*DTORAD 
Cl =COS ( ARAD ) 

SI =S IN (ARAD) 

CALL JMOVE(5.+RAD2*C1 ,5.+RAD2*S1 ) 

CALL JDRAW(5.+RAD3*C1 ,5.+RAD3*S1 ) 

C 

IF (AMID. LT. 45. .OR. AMID ,GE. 315.) CALL JJUST(1,2) 

IF (AMID .GT. 45. .AND. AMID .LT. 135.) CALL JJUST(2,1) 
IF (AMID .GE. 135. .AND. AMID .LT. 225.) CALL JJUST(3,2) 
IF (AMID .GE. 225. .AND. AMID .LT. 315.) CALL JJUST(2,3) 
C 

CALL JMOVE(5.+RAD4*C1 ,5.+RAD4*S1 ) 

5000 CALL JHSTRG ( LABEL ( I ) ) 


CLOSE THE TEMPORARY SEGMENT. 
CALL JCLOSE 


PAUSE TO VIEW CHART. 
CALL JPAUSE(IDEV) 


TERMINATE DI-3000; ALL DEVICES ARE DESELECTED AND TERMINATED. 
CALL JEND 
STOP 
END 


3-9 6 



MATERIALS 





Figure 3-33. Complete pie chart program. 


3-9 




3.5.4 Steps in Plott ing a Pie Chart with a Kev 


In context, a simple pie chart has been demonstrated. The next evolutionary 
step is the addition of a key. A key is a list of words or phrases giving an 
explanation of symbols or abbreviations (Figure 2-6 indicates a key in a pie 
chart). 

In order to add a key, four steps are necessary: 

1) declare and allocate key related variables; 

2) initialize the key related variables by calling CKEYIN; 

3) for each data set to be represented in the key, call CKEYLB. This call 
should be performed when the pie segment is to be drawn, since this 
routine will save off various DI-3000 and CGL attributes currently active; 

4) finally to plot the key, call CKEYPL. This call should be performed in 
page coordinates. 

Step 1 - Declare and allocate variables 

A key is a series of entries (lines), where each entry is stored internally as a 
collection of attributes. The user is required to declare and allocate storage for 
these attributes. Specifically, two variables are needed, ISTORE (storage array 
for attributes) and KEYCHR (storage array for line labels). The dimensions of 
these arrays should be large enough to accommodate the largest number of 
data sets plotted at one time. See the description of the routine CKEYPL in 
Appendix A for a more detailed description. 


C NLINS 
C *9 
C 

C (Note, 


PARAMETER (NLINS=8) 

- the maximum number of lines in the key 

- the largest character string per entry 
(including mnemonics) 

in this example 20 is used, could be any value.) 


CHARACTER KEYCHR ( 1 , NLINS) *9 
INTEGER ISTORE (15, NLINS) 



Step 2 - Initialize the key related variables by calling CKEYIN. This initialization 
can be performed anywhere, at anytime (i.e., the variables passed to CKEYIN 
will be reset). 


C Set window to match page coordinates 

CALL JWINDO (0 . , 10 . , 0 . , 10 . ) 

CALL JOPEN 

CALL CKEYIN ( ISTORE , KEYCHR, NLINS, NCOLS, NTLINS) 


Step 3 - For each data set to be represented in the key, call CKEYLB. This call 
should be performed when the data is to be drawn, since this routine 
will save off various DI-3000 and CGL attributes currently active. The 
key related variables will be assigned values to be plotted when all 
the key entries have been obtained. This typically requires the 
plotting of the data (in terms of data coordinates). 

• 

C Plot the pie segments 
do l 1=1 , NUMSEG 


C Set pie segment attributes 
CALL JPIDEX ( I, 1+30) 
CALL JSECTR (...) 


CALL CKEYLB ( ISTORE, KEYCHR, -4, LABEL (I) ) 
1 CONTINUE 




3-99 



Step 4 - Finally to plot the key, call CKEYPL. When all the key entries have 
been made, a call to CKEYPL will plot the key based on the attributes stored in 
ISTORE and KEYCHR (and a few internal variables). 


C Now output the key 
C Set the key position. 

BPOS ( 1 ) = . . . 

BPOS (2 ) = . . . 

C Plot the key 

CALL CKEYPL (ISTORE, KEYCHR, ’ ' , BPOS, 5, 1, 0) 

CALL JCLOSE 

• 

• 

C Terminate graphics 
CALL JPAUSE ( IDEV) 

CALL JFRAME 
CALL JDEVOF ( IDEV) 

CALL JDEND ( IDEV) 

CALL JEND 

• 


3-100 



3.5.5 Complete Pr ogram Plotting a Pie Chart with a Kev 


The following program is used to demonstrate how to embed these four steps 
into a complete program. Figure 3-34 shows the graphics output from the 
following program. 

PROGRAM CDP3 



C BASIC PIE CHART WITH A LEGEND 

C 

C INITIALIZE DATA 

REAL OFFSET, RAD 1 ,RAD2 ,RAD3 ,RAD4 
REAL BPOS ( 4 ) 

REAL XV( 4) , YV( 4 ) , ZV( 4 ) , REGION ( 8 ) 

CHARACTER*! 4 LABEL ( 8 ) 

CHARACTER * 4 YEAR 
C 

CHARACTER KEYCHR ( 1 , 8 ) * 1 5 
INTEGER ISTORE (15,8) 

DATA OFFSET, RADI , RAD2 , RAD3 , RAD4 / . 5 , 4 . , 4 . 7 , 5 .7 , 5 . 9/ 

DATA REGION ( 1 ) , REGION( 2 ) , REGION ( 3 ) , REGION ( 4) /2 . 1 , .6, 2. 4, 2. 8/ 

DATA REGION ( 5 ) , REGION ( 6 ) ,REGION(7) ,REGION( 8 ) /.4 , 1 .3,1 .8,3.2/ 

C 

DATA YEAR /'1988'/ 

C 

DATA LABEL (1 ) / ' N l BLC] ICKEL ' / 

DATA LABEL ( 2 ) / ' M [ BLC ) AGNES IUM' / 

DATA LABEL ( 3) / 1 A (BLC] LUMINUM' / 

DATA LABEL ( 4 ) / 1 I [ BLC ) RON 1 / 

DATA LABEL ( 5 ) / ' T [ BLC ] IN 1 / 

DATA LABEL ( 6 ) / ' C [ BLC] OPPER' / 

DATA LABEL ( 7 ) / 1 G [ BLC ] OLD ' / 

DATA LABEL ( 8 ) / ' Z [ BLC ] INC ' / 



C INITIALIZE DI-3000 
CALL JBEGIN 
CALL CBEGIN 



C WRITE TO THE DEVICE IDEV 
IDEV=0 

CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 



C DEFINE THE VIEWSPACE AND WINDOW OF SAME ASPECT RATIO 
CALL JVSPAC(-1 . ,1 . ,-1 . ,1 . ) 

CALL JWINDO( 0. ,10.,0.,10.) 




3-101 


oo no on no 


C FILL POLYGONS BY DEFAULT. 
CALL JDPINT(I) 


C OPEN A TEMPORARY SEGMENT FOR BORDERS. 
CALL JOPEN 

CALL JIWIND( XV , YV , ZV ) 

CALL JPIDEX( 4,0) 

CALL JPOLGN ( XV , YV , 4 ) 

CALL JSIZE( .6, .6) 

CALL JFONT( 5 ) 

CALL JJUST( 2,2) 

CALL JMOVE(5. ,9.1 ) 

CALL JHSTRG( 'CGL PIE GRAPH') 

CALL JMOVE ( .1 , .5) 

CALL JHSXTN ( YEAR , DX, DY ) 

CALL JPIDEX( 6 , 0 ) 

CALL JRRECT ( DX , DY ) 

CALL JJUST(1 , 1 ) 

CALL JHSTRG( YEAR) 

CALL JMOVE ( 9 . 9 , . 5 ) 

CALL JSIZE( .25, .25) 

CALL JFONT( 1 ) 

CALL J JUST (3,1 ) 

CALL JHSTRG( 1 PREPARED BY CSC') 


CLOSE THE TEMPORARY SEGMENT. 
CALL JCLOSE 


DESIGN THE PIE TO BE 50% SMALLER 
RADI =RAD1 -(RADI * .50) 
RAD2=RAD2-(RAD2*.50) 

RAD 3 =R AD 3- ( RAD 3* . 50 ) 
RAD4=RAD4- ( RAD 4* .50) 


COMPUTE THE FACTOR FOR CONVERTING DEGREES TO RADIANS. 
DTORAD=ATAN ( 1 .0)/45. 


TOTAL THE REGIONAL DATA. 

TOTAL=0 .0 
DO 3000 1=1 ,8 
3000 TOTAL = TOTAL+REGION ( I ) 



C OPEN A TEMPORARY SEGMENT FOR THE PIE CHART SECTORS AND LABELS. 
CALL JOPEN 

CALL CKEYIN(ISTORE,KEYCHR,8,1 ,1 ) 

START=5. 

CALL JSIZE( . 3, .3) 

CALL JFONT ( 1 ) 


I 


3-102 



on no no 


DO 5000 1=1 ,8 
A0=START 

A1 =REGION(I)/TOTAL*360.+START 
CALL JPIDEX( I , 1+30) 

CALL JSECTR(3.,5.,3.,RAD1 ,0,A0,A1 ) 

START=A1 

AMID* (A1 -AO) /2.+A0 
ARAD=AMID*DTORAD 
Cl COS (ARAD) 

SI =SIN( ARAD ) 

5000 CALL CKEYLB( ISTORE, KEYCHR, -4 , LABEL ( I ) ) 

BPOS ( 1 ) =9 . 5 
BPOS ( 2 ) =8 . 

CALL CKEYPL( ISTORE, KEYCHR, ' , BPOS , 5 , 1 , 0) 


CLOSE THE TEMPORARY SEGMENT. 
CALL JCLOSE 


PAUSE FOR OPERATOR ACTION. 
CALL JPAUSE(IDEV) 


TERMINATE DI-3000; ALL DEVICES ARE DESELECTED AND TERMINATED. 
CALL JEND 
STOP 
END 


3-103 



Figure 3-34. Pie chart with a key. 


3-104 



3.5.6 Plotting a Pie Chart with Exploded Segments 


In order to plot an exploded pie chart, all steps are the same as in the previous 
examples, except for the positioning of each segment. For pie charts with 
non-exploded segments, the origin of the pie segments are fixed. The only 
change needed to generate pie charts with exploded pie segments, is to vary 
the origin of the pie segments. 

For non-exploded segments 

X0= {a fixed value} 

Y0= {a fixed value} 

DO 1 1 = 1 , NUMSEG 

CALL JSECTR (XO, YO, . . .) 

1 CONTINUE 


For exploded segments 

DO 1 1=1, NUMSEG 

X0= {a changing value} 

Y0= {a changing value} 

CALL JSECTR (XO, YO, . . . ) 

1 CONTINUE 

A complete pie chart program follows, illustrating a pie chart with exploded 
segments. The corresponding graphics output can be found in Figure 3-35. 


PROGRAM CDP2 

c- 

c EXPLODED PIE CHART 

C 

C INITIALIZE DATA 

REAL OFFSET, RADI , RAD2 ,RAD3 , RAD4 
REAL XV ( 4 ),YV(4),ZV(4), REGION ( 8 ) 

CHARACTER* 14 LABEL(8 ) 

CHARACTER *4 YEAR 
C 

DATA OFFSET, RADI ,RAD2,RAD3,RAD4 /. 25 , 2 . , 2 . 35 , 2 .85, 2 . 95/ 

DATA REGION ( 1 ) , REGION ( 2 ) , REGION ( 3 ) , REGION ( 4 ) /2 1 . , 6 . , 2 4 . , 28 . / 
DATA REGION(5) ,REGION(6) , REGION(7 ) ,REGION( 8 ) /4 . , 1 3. , 1 8 . , 32 . / 
C 

DATA YEAR /’I 988'/ 

C 


3-105 


o o o o 


DATA LABEL (1 ) / 1 N { BLC ] ICKEL ' / 

DATA LABEL ( 2 ) / ' M [BLC] AGNES IUH' / 

DATA LABEL ( 3 ) / 1 A[ BLC] LUMINUM 1 / 

DATA LABEL(4)/’G(BLC]0LD’/ 

DATA LABEL ( 5 ) / 1 1 1 BLC ] RON ' / 

DATA LABEL ( 6 ) / ' S [ BLC ] ILVER ' / 

DATA LABEL ( 7 ) / ’ C [BLC] OPPER' / 

DATA LABEL ( 8 ) / ' L [ BLC ) EAD ' / 

C 

C INITIALIZE DI-3000 
CALL CBEGIN 
CALL JBEGIN 

C 

C WRITE TO A DEVICE IDEV 
IDEV-0 

CALL JDINIT(IDEV) 

CALL JDEVON(IDEV) 



C DEFINE THE VIEWSPACE AND WINDOW OF SAME ASPECT RATIO 
CALL JVSPAC(-1 . ,1 . ,-1 . , 1 • ) 

CALL JWINDO(0. ,10. ,0. ,10. ) 



C FILL POLYGONS BY DEFAULT 
CALL JDPINT( 1 ) 



C OPEN A TEMPORARY SEGMENT FOR BORDERS. 

CALL JOPEN 

CALL JIWIND ( XV , YV, ZV ) 

CALL JPIDEX(4 , 0) 

CALL JPOLGN ( XV , YV , 4 ) 

CALL JSIZE( .5, .5) 

CALL JFONT( 3 ) 

CALL J JUST (2, 2) 

CALL JMOVE(5. ,9.2) 

CALL JHSTRG( 'MATERIALS’ ) 

CALL JMOVE( .1 , .8) 

CALL JHSXTN ( YEAR ,DX,DY ) 

CALL JPIDEX(6,0) 

CALL JRRECT(DX.DY) 

CALL JJUST(1 ,1 ) 

CALL JHSTRG( YEAR) 

CALL JMOVE (9.9, . 8 ) 

CALL JSIZE( .25, .25) 

CALL JFONT ( 1 ) 

CALL JJUST( 3, 1 ) 

CALL JHSTRG( ’PREPARED BY CSC') 


CLOSE TEMPORARY SEGMENT 
CALL JCLOSE 


COMPUTE THE FACTOR FOR CONVERTING DEGREES TO RADIANS. 
DTORAD=ATAN( 1 .0)/45. 


3-106 



ooooo oooo oo oo 


r 


TOTAL THE REGIONAL DATA. 
TOTAL=0 .0 
DO 3000 1=1 ,8 

3000 TOTAL = TOTAL+REGION ( I ) 


OPEN A TEMPORARY SEGMENT FOR THE PIE CHART SECTORS AND LABELS. 
CALL JOPEN 
START=5 . 

CALL JSIZE( .15, .15) 

CALL JFONT(1 ) 

DO 5000 1=1 ,8 
A0=START 

A1 =REGION ( I ) /TOTAL* 360 . +START 
START=A1 

AMID=(A1-A0)/2. +A0 
ARAD=AMID*DTORAD 
Cl =COS ( ARAD ) 

SI =S IN (ARAD) 

CALL JPIDEX( 1,1+30) 

XO=OFFSET*C1 +5 . 

YO=OFFSET*S1 +5 • 

CALL JSECTR(X0,Y0,0. , RADI ,0,A0,A1 ) 

CALL JMOVE(RAD2*C1 +5. ,RAD2*S1 +5. ) 

IF (AMID. LT. 45. .OR. AMID .GE. 315.) CALL JJUST(1,2) 

IF (AMID ,GT. 45. .AND. AMID .LT. 135.) CALL JJUST(2,1) 
IF (AMID .GE. 135. .AND. AMID .LT. 225.) CALL JJUST(3,2) 
IF (AMID .GE. 225. .AND. AMID .LT. 315.) CALL JJUST(2,3) 

CALL JMOVE(RAD4*C1 +5. ,RAD4*S1 +5. ) 

5000 CALL JHSTRG(LABEL(I) ) 


CLOSE TE TEMPORARY SEGMENT. 
CALL J CLOSE 


C PAUSE TO VIEW CHART. 

CALL JPAUSE(IDEV) 

C 

C TERMINATE DI-3000; ALL DEVICES ARE DESELECTED AND TERMINATED. 
CALL JEND 
STOP 
END 


3-107 


h exploded segments. 


8 




3.6 Steps in the Generation of Composite Charts 


The previous subsections described how to generate the various chart types 
offered by the Common Graphics Library (CGL). The following sections 
describe how to create a composite chart (i.e., multiple charts on a single 
display area). 

3.6.1 Arranging Composite Charts 

Multiple charts can be displayed on a single frame by opening and closing 
several windows and viewports, and plotting the axes and data corresponding 
to each chart. Although many charts can be displayed on a page, the user 
should keep in mind the readability of the resultant chart. When plotting the 
composite chart, it is recommended one chart be done at a time, and each be 
done in its own segment. The following is a skeleton program showing the 
major elements involved in the generation of composite charts. 

PROGRAM . . . 

CALL CBEGIN 
CALL CVSPAC (...) 


{Repeat this section of code for every chart.} 

CALL JWINDO ( . . . ) {page coordinates} 

CALL JOPEN 
CALL CHAXIS (...) 

CALL CVAXIS (...) 

{save the axes' diagonals virtual values) 
CALL JCONWV ( . . . ) 

CALL JCLOSE 


CALL JWINDO (...) {data coordinates} 

CALL JVPORT ( . . . ) {set viewport based on JCONWV} 
CALL JOPEN 

CALL CLNPLT ( . . ) {plot data} 

CALL JCLOSE 


CALL JDEVOF ( . . . ) 
CALL JDEND (...) 
CALL JEND 
STOP 
END 


3-109 


In the preceding skeleton program, a window is opened to draw the axes (i.e., 
page related components), and then a window is opened to draw the data. 
These steps (indicated above between the dashed lines) should be repeated 
for each chart. 

3.6.2 Complete Program Plotting a Composite Chart 

The following program shows how to generate a composite chart. The resultant 
graphical output is found in Figure 3-36. 

PROGRAM CDC1 

c 

c COMPOSITE CHART (IE, TWO CHARTS ON ONE PAGE) 



C ALLOCATE AND INITIALIZE DATA 

PARAMETER (MAXPTS=10, MAXS ET=4) 

REAL X ( MAXPTS , MAXS ET ) , Y ( MAXPTS , MAXS ET ) 

DATA (X(KI, 1 ) ,KI=1 ,10) 

+ /0 • , #1 , . 2 , • 3 , *4, *5, .6, *7, *8, ,9/ 

DATA ( X ( KI , 2 ) ,KI=1 ,10) 

+ / » 1 , • 1 5, *3, *35, .45, .55, .65, .75, .85,1 .2/ 

DATA(X(KI, 3) ,KI=1 ,10) 

+ /.O, .1 , .2, .3, .4, .5, .6, .7, .8, .9/ 

DATA( X(KI , 4 ) ,KI=1 ,10) 

+ /.I , .2, .4, .6, .7, .8, .9,1 .,1 .1 ,1 .2 / 

DATA (Y(KI, 1 ) ,KI=1 ,10) 

+ /O., 2., 4., 7., 10., 12., 15., 18., 21., 24./ 

DATA ( Y(KI , 2 ) ,KI=1 ,10) 

+ /I .,3., 5. ,8., 11 .,13., 16. 5, 20., 22., 23./ 

DATA ( Y(KI , 3 ) ,KI=1 ,10) 

+ /O. , .005, .01 , .015, .02, .025, .029, .03, .035, .04/ 

DATA (Y(KI,4) ,KI=1 ,10) 

+ /-.005,-.01 ,-.01 5, -.02, -.025, -.03, -.04, -.05, -.065, -.08/ 



C WRITE TO THE DEVICE IDEV 
IDEV=0 
CALL CBEGIN 
CALL JBEGIN 
CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 

C 

C ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
XS= . 2 
YS=6 .0 

CALL CVSPAC ( 1 0. , 1 0 . ) 

CALL J4RGET( 2 , VX3 , VX4 ,VY3, VY4) 

CALL JWINDO (0.,10.,0.,10.) 

CALL JOPEN 


3-110 


C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 

CALL JSIZE(XS,XS*1 .25) 

C POSITION TEXT, AND SET TTEXT JUSTIFICATION (CENTER, CENTER) 

CALL JMOVE(5. 0,10.0) 

CALL JJUST( 2,3) 

C OUTPUT THE STRING 

CALL JHSTRGCA TtBLC] ITLE* ) 

C RESET THE CHARACTER SIZE FOR THE AXES 
CALL JSIZE(XS,XS*1 .25) 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
XORG=2. 

YORG* 2.0 

CALL JMOVE ( XORG , YORG ) 

C DESCRIBE THE HORIZONTAL AXIS 
CALL CHLAB( 'ClBSUBlL* ,1 ) 

CALL CHTICJ ( 1 ) 

C XLEN-REPRESENTS THE X-AXIS LENGTH 
XLEN=6 .0 
CALL CHPREC ( 1 ) 

CALL CHAXIS( - .2, 1.2, .2, XLEN) 

C DESCRIBE THE VERTICAL AXIS 

CALL CVLAB( • [FONT=9] [BLC] A[FONT*3) ,DEG' , 1 ) 

CALL CVPREC { 3 ) 

CALL CVTICJ(1 ) 

C YLEN-REPRESENTS THE Y-AXIS LENGTH 
YLEN=3 .5 
CALL CVPREC ( - 1 ) 

CALL CVJUST(1 ) 

CALL CVAXIS (-4. ,24. ,4. , YLEN ) 

C SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV( XORG, YORG, 0. ,VX1 ,VY1 ) 

CALL JCONWV(XORG+ XLEN, YORG+ YLEN, 0. ,VX2,VY2) 

C CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES) 

CALL JCLOSE 

C 

C SET WINDOW TO MATCH DATA COORDINATES, AND PLOT WITHIN BOUNDARIES 
C OF THE AXES (BY SPVED VIRTUAL COORDINATES) 

CALL JWINDO( - .2 , 1. 2,-4., 24.) 

C -.2,1.2 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE X-DIRECTION 
C -4., 24. - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE Y-DIRECTION 
CALL JVP0RT(VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 

C PLOT FIRST DATA CURVE 
CALL CSYMNO( 1 ) 

CALL CLNPAT( 1 ) 

CALL CLNPLT ( X , Y ( 1 , 1 ) , MAXPTS ) 

C SET SYMBOL NUMBER TO 902, AND PLOT SECOND DATA CURVE 
CALL CSYMNO( 2 ) 

CALL CLNPAT( 2 ) 

CALL CLNPLT ( X, Y ( 1 , 2 ) , MAXPTS ) 

CALL JCLOSE 


3-1 1 1 



no o o ooooo o no 


WORK ON SECOND GRAPH 

CALL JWINDO (0. ,10.,0.,10.) 

CALL JVPORT( VX3, VX4,VY3,VY4) 

CALL JOPEN 

CALL JSIZE(XS,XS*1 .25) 

CALL JMOVE ( XORG , YS ) 

YLEN- REPRESENTS THE Y-AXIS LENGTH 
CALL CVLAB( ’C[BSUB] [BLC]M' , 1 ) 

CALL CVPREC ( 2 ) 

CALL CVAXIS(-.08, .04, .04, YLEN) 

SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV ( XORG, YS , 0 . ,VX1 ,VY1 ) 

CALL JCONWV ( XORG+XLEN ,YS+3.5,0.,VX2, VY2 ) * 

CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES) 

CALL JCLOSE 


SET WINDOW TO MATCH DATA COORDINATES AND PLOT WITHIN BOUNDARIES 
OF THE AXES (BY SAVED VIRTUAL COORDINATES) 

CALL JWINDO (- .2,1 .2, -.08. .04) 

CALL JVPORT( VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 

PLOT THIRD DATA CURVE 
CALL CSYMNO(I) 

CALL CLNPAT ( 1 ) 

CALL CLNPLT(X,Y( 1,3) ,MAXPTS) 

PLOT FOURTH SET OF DATA POINTS 
CALL CSYMNO( 2 ) 

CALL CLNPAT ( 2 ) 

CALL CLNPLT (X,Y(1 ,4) , MAXPTS ) 

CALL JCLOSE 


TERMINATE GRAPHICS 

CALL JPAUSE(IDEV) 

CALL J FRAME 

CALL JDEVOF(IDEV) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


3-112 




4. ADDITIONAL CAPABILITIES 


This section describes capabilities and methodologies useful in generating and 
debugging programs using the Low-Level graphics programs. Currently, this 
section contains error detection and debugging capabilities. This section will 
be expanded to include additional capabilities as they are developed. 

4.1 Error Detection and Debugging Capabilities 

A fundamental premise of the Low-Level routines states that correct usage of the 
routines will generate a chart as described by this document. Correct usage 
consists of a proper sequence of calls with a proper set of routine arguments. 

4.1.1 E rror De tectio n 

The error detection mechanism implemented in the Low-Level routines is passive; 
that is as errors are detected, error messages are written to a specified destination. 
The error mechanism requires no calls to initiate, as error detection is automatically 
performed. However, there is no means of error inquiry, nor any means of 
user-definable error recovery. 

The errors detected by the Low-Level routines are classified as non-fatal and fatal. 
Non-fatal errors are considered tolerable in that the Low-Level routines can make 
suitable adjustments and continue processing. Fatal errors are those which are so 
severe that error recovery cannot occur, and the program terminates. All errors and 
their types are included in Appendix A under the routine which can generate them). 

An example of a non-fatal error is to pass a value out of range for a subroutine 
argument. An appropriate error message will be written indicating that the 
information cannot be used. Typically, errors due to invalid values will result in the 
arguments being set to their defaults (see Appendix A for defaults). 

Figure 4-1 shows an example of the error detection and reporting features, along 
with the corresponding graphics output. Note, as shown by the following example, 
the default destination of the error messages is the output device (often overwriting 
the graphics output). Refer to Section 4.1.3 for changing the destination of output. 


4-1 



on o o 


The following program illustrates the Low-Level error detection mechanism. 

PROGRAM CDD1 

C 

C AN EXAMPLE SHOWING A SIMPLE CGL ERROR. 

C 

C ALLOCATE AND INITIALIZE DATA 
PARAMETER ( MAXPTS=5) 

REAL X ( MAXPTS ) , Y ( MAXPTS ) 

DATA X/5. 5, 6. 5, 7. 5, 8. 5, 9. 5/, Y/. 001 , .0075, .006, .009, .002/ 


WRITE TO THE METAFILE 
IDEV=0 
CALL C BEG IN 
CALL JBEGIN 
CALL JDINIT(IDEV) 
CALL JDEVON ( IDEV ) 


ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC(9. ,9.) 

CALL JWINDO (0.,9.,0.,9.) 

CALL JOPEN 

C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 

CALL JSIZE( .2, .2*1 .25) 

C POSITION TEXT, AND SET TEXT JUSTIFICATION (CENTER, CENTER) 
CALL JMOVE (4. 5, 6.0) 

CALL JJUST( 2,2) 

C OUTPUT THE STRING 

CALL JHSTRGCA TtBLC] ITLE* ) 

C RESET THE CHARACTER SIZE FOR THE AXES 
CALL JSIZE( .1 , .1*1 .25) 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
XORG=2 . 

YORG=2 . 

CALL JMOVE (XORG,YORG) 

C DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB ( ' H [ BLC ) ORI ZONTAL [BUC] AtBLClXIS 1 , 1 ) 

CALL CHTICJ(-I) 

C XLEN - REPRESENTS THE X-AXIS LENGTH 
XLEN=4 .0 

CALL CHAXIS( 5 . , 1 0. , 1 . ,XLEN) 

C DESCRIBE THE VERTICAL AXIS 

CALL CVLAB ( ' V I BLC ) ERTICAL [ BUC] A [BLC] XIS ' , 1 ) 

CALL CVPREC ( 3 ) 

C YLEN - REPRESENTS THE Y-AXIS LENGTH 
YLEN=3 .5 

CALL CVAXIS( .0, .01 , .01 , YLEN) 

C SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV( XORG, YORG, 0. ,VX1 ,VY1 ) 

CALL JCONWV(XORG+ XLEN, YORG+ YLEN, 0. ,VX2,VY2) 

CALL JCLOSE 


4-2 





C SET WINDOW TO HATCH DATA COORDIATES, AND PLOT WITHIN 
C BOUNDARIES OF THE AXES (BY SAVE VIRTUAL COORDINATES) 

CALL JWINDO(5. , 10. , .0, .01 ) 

C 5,10 - REPRESENTS THE DATA BOUNDARIES IN THE X-DIRECTION 
C 0,.01 - REPRESENTS THE DATA BOUNDARIES IN THE Y-DIRECTION 
CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 
C PLOT DATA CURVE 

CALL CSYMNOO ) 

CALL CLNPAT(I) 

CALL CLNPLT ( X , Y , MAXPTS ) 

CALL JCLOSE 

C 

CALL JPAUSE(IDEV) 

CALL J FRAME 
CALL JDEVOF(IDEV) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


CHTICJ : IMPROPER ENTRY GIVEN FOR POSITIONING 

OF TICKMARKS. VALUE MUST BE 0, 1, 

2, OR 3. DEFAULT VALUE OF 1 IS USED. 

A Title 



Figure 4-1. Low-Level error detection mechanism. 


4-3 


4.1.2 Debugging Capabilities 


The Low-Level routine CDEBUG provides a method for recording the calls to 
and the arguments of the Low-Level routines. This enables the user to validate 
the sequence of Low-Level calls, along with their arguments. There are two 
debug levels: 0 (OFF) or 1 (ON). Initially, the debug level is OFF (i.e., the 
default), but can be turned ON or OFF at any time. The user can control the 
amount and content of debugging output by setting the level to include or 
exclude sections of code to be monitored. To enable Low-Level debugging, the 
user can enter 

CALL CDEBUG (1) 

To disable Low-Level debugging, the user can enter 

CALL CDEBUG (0) 

When the debugging level in ON and a Low-Level routine is entered, the 
following message(s) will be written: 

routine name: ENTER 

argument_l : argument type VALUE= value 

argument_2 (1) : argument type VALUE= value 

argument_3 (EQ) : argument type VALUE= value 

where the lower-case strings will be replaced by actual values (see the 
following example). Note, when an argument is an array, then a one in 
parentheses will follow the argument (see argument_2 above), and the first 
value of the array will be displayed. If an argument may vary in type depending 
on the context (e.g., INTEGER in one case, and REAL in another), then an "EQ" 
in parentheses will follow the argument (see argument_3 above), and the 
corresponding value of all applicable types will be displayed (see the following 
example). 

Similarly, when the debugging level is ON and a Low-Level routine is exited, 
the following message(s) will be written: 

routine name: EXIT 

where routine name will be replaced with an actual routine name (see the 
following example). This information validates the sequence of Low-Level calls, 
along with the values and types of the corresponding arguments. 


4-5 


PRECEDING PAGE BLANK NOT FILMED 



The following partial program illustrates the debugging capability along with 
some sample output. This program is similar to the previous program; a call to 
CDEBUG should be noted. 

PROGRAM CDD2 

C 

C AN EXAMPLE SHOWING A DEBUGGING CAPABILITIES. 



C ALLOCATE AND INITIALIZE DATA 
PARAMETER ( MAXPTS= 5 ) 

REAL X ( MAXPTS ) , Y ( MAXPTS ) 

DATA X/5. 5, 6. 5, 7. 5,8. 5,9. 5/, Y/. 001 , .0075, .006, .009, .002/ 



C WRITE TO THE METAFILE 
IDEV=0 
CALL CBEGIN 
CALL JBEGIN 
CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 



C DEBUGGING TURNED ON FOR USER-CALLABLE ROUTINES. 

CALL CDEBUG ( 1 ) 




CALL JWI NDO (5.,10.,.0,.01) 

C 5,10 - REPRESENTS THE DATA BOUNDARIES IN THE X-DIRECTION 
C 0, .01 - REPRESENTS THE DATA BOUNDARIES IN THE Y-DIRECTION 
CALL JVPORT( VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 
C PLOT DATA CURVE 

CALL CSYMNO(I) 

CALL CLNPATO ) 

CALL CLNPLT(X,Y, MAXPTS) 

CALL JCLOSE 

C 

CALL JPAUSE(IDEV) 

CALL J FRAME 
CALL JDEVOF ( IDEV ) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


4-6 



The following output reflects the debug messages written to the default 
destination TAPE77 (logical unit 77). 


CDEBUG : ENTER 
IDBLVL 

INTEGER 

VALUE 


CDEBUG: EXIT 
IDBLVL 

: REAL 

VALUE 

CVSPAC : ENTER 
WIDTH : 

REAL 

VALUE 

= 

HEIGHT : 

REAL 

VALUE 


CVSPAC: EXIT 
CHLAB: ENTER 
CHARA ( 1 ) : 

CHAR* (*) 

VALUE 


NLINE : 

INTEGER 

VALUE 

= 

CSTRIP : ENTER 
STRING 

CHARM*) 

VALUE 

s 

CSTRIP: EXIT 
CHLAB: EXIT 
CHAXIS : ENTER 
HZMIN : 

REAL 

VALUE 


HZMAX : 

REAL 

VALUE 

= 

TINCR : 

REAL 

VALUE 


HLONG : 

REAL 

VALUE 

* 

CGTSTR : ENTER 
VALUE (EQ) : 

REAL 

VALUE 


NDEC : 

INTEGER 

VALUE 

= 

CSTRIP: ENTER 
STRING : 

CHARM*) 

VALUE 

sc 

CSTRIP: EXIT 

CHAXIS: EXIT 
CVLAB: ENTER 
CHARA (1) : 

CHAR* (*) 

VALUE 


NLINE : 

INTEGER 

VALUE 

55 

CSTRIP: ENTER 
STRING : 

CHAR* (*) 

VALUE 

_ 

CSTRIP: EXIT 
CVLAB: EXIT 





i 


- i 


9. 


9. 


H [BLC] ORIZONTAL (BUC] A [BLC] XIS 
1 

H[ BLC] ORIZONTAL [BUC] A [BLC] XIS 


5. 

10 

1. 

4. 

0. 

-1 


5 


V[BLC] ERTICAL [ BUC ) A ( BLC ] XIS 
1 

V [BLC] ERTICAL ( BUC ] A [ BLC ] XIS 


m 


CLNPLT : ENTER 

X(l) : 

REAL 

VALUE 

= 5.5 

Y(l) : 

REAL 

VALUE 

= .001 

N : 

INTEGER 

VALUE 

- 5 

CPNTPT : ENTER 

A : 

REAL 

VALUE 

« 5.5 

B 

REAL 

VALUE 

= .001 

CPNTPT: EXIT 




4-7 





4.1.3 Destination of Output 


9 


The routine CFILES enables the user to control the output destination of error 
and debug processing. Error messages, both fatal and non-fatal, are written by 
default to output device (i.e., the current display device). This is often 
undesirable as it will overwrite graphics output. To redirect Low-Level error 
messages the user can call 

ICODE=l 

CALL CFILES (ICODE, logical unit, filename) 

The above call will inform the Low-Level routines to redirect the subsequent 
Low-Level error messages , indicated by the first argument, to the logical unit 
with the associated filename . If the file is not already open, CFILES will open 
the file with the appropriate filename and logical unit number as indicated. 

Debug messages, when turned on by CDEBUG, have the default destination of 
file TAPE77 associated with the logical unit 77. To redirect Low-Level debug 
messages the user can call 

ICODE=2 

CALL CFILES ( ICODE, logical unit , filename ) 

The above call will inform the Low-Level routines to redirect the subsequent 
Low-Level debug messages , indicated by the first argument, to the logical unit 
with the associated filename . If the file is not already open, CFILES will open 
the file with the appropriate filename and logical unit number as indicated. 

It is often advantageous to redirect output from several processes into a single 
output destination. This will provide the user with a single collection of 
information in the order in which the appropriate processes were executed (i.e., 
Low-Level error messages, Low-Level debug messages, underlying graphics 
package messages, and user generated messages). 


4-9 



oooooo oo 


The following partial program illustrates the changing of the error and 
debugging destination. This program is similar to the previous program; two 
calls to CFILES should be noted. 


PROGRAM CDD3 

c 

C AN EXAMPLE SHOWING A ERROR AND DEBUGGING REDIRECTION. 

C 

C ALLOCATE AND INITIALIZE DATA 
PARAMETER ( MAX PTS= 5 ) 

REAL X ( MAXPTS ) , Y ( MAXPTS ) 

DATA X/5. 5, 6. 5, 7. 5, 8. 5, 9. 5/, Y/. 001 , .0075, .006, .009, .002/ 


WRITE TO THE METAFILE 
IDEV=0 
CALL CBEGIN 
CALL JBEGIN 
CALL JDINIT(IDEV) 
CALL JDEVON ( IDEV ) 


WRITE CGL ERROR MESSAGES TO UNIT 80, FILE 1 TAPE80 ' . 
CALL CFILES( 1 ,80, 'TAPE80' ) 


WRITE CGL DEBUG MESSAGES TO UNIT 80, FILE ' TAPE80 ' . 
CALL CFILES (2,80, 1 TAPE80' ) 


DEBUGGING TURNED ON FOR USER-CALLABLE ROUTINES. 
CALL CDEBUG(I) 

C 




C PLOT DATA CURVE 

CALL CSYMNO(I) 

CALL CLNPAT(I) 

CALL CLNPLT(X,Y, MAXPTS) 
CALL JCLOSE 

C 

CALL JPAUSE(IDEV) 

CALL JFRAME 
CALL JDEVOF ( IDEV ) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


4-10 



Note, this example redirects both error and debugging messages and combines 
them in the same file for ease of debugging. The user could also write to the 
same unit, possibly delimiting sections of this file to examine carefully. 


CDEBUG : ENTER 
IDBLVL : 

INTEGER 

VALUE 

= 1 


CDEBUG: EXIT 
IDBLVL 

: REAL 

VALUE = 1 


CVSPAC : ENTER 
WIDTH : 

REAL 

VALUE 

= 9. 


HEIGHT : 

REAL 

VALUE 

* 9. 


CVSPAC: EXIT 
CHLAB: ENTER 
CHARA(l) : 

CHAR* (*) 

VALUE 

- H ( BLC j OR I ZONTAL 

t BUC ] A [BLC ) XIS 

NLINE : 

INTEGER 

VALUE 

= 1 


CSTRIP : ENTER 
STRING : 

CHAR* (*) 

VALUE 

= H { BLC ] ORIZONTAL 

[ BUC ] A [ BLC J XIS 

CSTRIP: EXIT 
CHLAB: EXIT 
CHTICJ: ENTER 
IV 

INTEGER 

VALUE 

= -1 


CHTICJ: IMPROPER ENTRY 

GIVEN 

FOR POSITIONING 



OF TICK MARKS. VALUE MUST BE 0, 1, 

2, OR 3. DEFAULT VALUE OF 1 IS USED. 
CHTICJ: EXIT 


CHAXIS : ENTER 


HZMIN : 

REAL 

VALUE 

- 

5. 


HZ MAX : 

REAL 

VALUE 


10. 


TINCR : 

REAL 

VALUE 

= 

1. 


HLONG : 

REAL 

VALUE 


4. 


CGTSTR : ENTER 






VALUE (EQ) : 

REAL 

VALUE 


0. 


NDEC : 

INTEGER 

VALUE 

= 

-1 


CSTRIP: ENTER 






STRING 

CHAR* ( * ) 

VALUE 

- 



CSTRIP: EXIT 





• 






• 






m 

CLNPLT: ENTER 






XU) : 

REAL 

VALUE 


5.5 


Y ( 1 ) : 

REAL 

VALUE 

= 

.001 


N : 

INTEGER 

VALUE 


5 


CPNTPT : ENTER 






A : 

REAL 

VALUE 

= 

5.5 


B : 

REAL 

VALUE 

= 

.001 


CPNTPT: EXIT 





+ 






m 






• 


4-1 1 



5. INTERFACING WITH OTHER GRAPHICS PACKAGES 

This section describes how to interface the CGL (focusing on the Low-Level 
routines) with other graphical packages. This section will identify what 
requirements are necessary to interface with the CGL, and how to interface. The 
description of interfacing will consist of a generalized method, followed by a 
specific example (i.e., interfacing with the CGL LEZ routines). 

Why interface with the CGL? The Low-Level routines of the CGL provide 
primitive graphical entities (i.e., NASA symbols, NASA line patterns), and 
compound graphical entities (i.e., axes, grids, plotting an array, etc.). Because 
these entities are part of a chart and are basic in nature, there are fewer graphical 
and computational inherent limitations than with a higher-level graphics package. 

These limitations may be graphical or computational. For example, the LEZ 
routines have a limited number of points which can comprise a data set 
representing a curve. This limit exists because the LEZ routines must store this 
information internally. The Low-Level routines display a set of data directly 
supplied by the user, thus the maximum is limited by the size of the array the user 
can allocate. Similarly, the Low-Level routines may be used to augment the 
graphical capabilities of a limited package. For example, the LEZ routines only 
produce a single set of X and Y axes, whereas the Low-Level routines can be 
called repeatedly to generate several additional axes. 


5.1 Requirements for Interfacing with the CGL 

In order to interface with the CGL, it is assumed that a program (i.e., possibly 
FORTRAN, C, etc.) will invoke the CGL and generate graphics output (i.e., either 
interactively, or to a metafile). Thus, the appropriate software tools (i.e., device 
drivers, metafile translators, etc.) are assumed prerequisites when needed. 

All computer programs require system resources (i.e., I/O units, field length, 
device interaction, etc.), and thus must be coordinated. Since the CGL resides on 
top of a general purpose graphics package, that package must be available and 
be able to be invoked. If an additional graphics package is to be invoked, then it 
will either: 


- use the same underlying graphics package; or 

- require the use of another primitive graphics package. 


5-1 



When using a different underlying graphics., package, (e.g., using CGL with 
DI-3000, and another package, possibly GKS), the graphical resources (e.g., 
graphics devices, metafiles, etc.) are in contention. Typically, these resources are 
non-sharable simultaneously. However, it may be possible to perform the 
graphical operations from one package, display the results, terminate that 
package, then subsequently use the second package to generate graphics on the 
same display device. This is only possible if both packages can access the same 
device, and the transition between the two graphics packages can be 
coordinated. This is typically not the case, as termination and initialization of 
graphics packages often clear the display device. As an alternative approach, 
generate the plots separately, then if the metafile translator recognizes the file 
representation (i.e., metafile, SAVPLT, etc.) combine the chart appropriately. 

When using the same underlying graphics package (e.g., using CGL with 
DI-3000, and the LEZ with DI-3000) the graphics resources are also in 
contention, but are typically sharable . The following subsections will work with 
this premise. 

5.2 Interfacing with a Generalized High-Level Graphics Package 

Sections 3.1 through 3.2 describe the characteristics of the underlying graphics 
package, and how to interface the CGL with such fundamental packages. This 
section will describe the general method of interfacing the Low-Level routines 
with high-level graphics packages. 

As indicated in Section 3, most underlying graphics packages operate on similar 
concepts. These concepts, as illustrated in Figure 5-1, consist of the 
establishment (i.e., initialization and termination) of the graphics package and the 
graphics devices, in addition to providing an appropriate graphical context 
necessary to use the Low-Level routines. 

The majority of the Low-Level routines must be called at a point when graphical 
output can be generated. When interfacing with the underlying graphics package 
such as DI-3000, this context is referred to as an opened segment . However, 
high-level graphics packages, such as LEZ and CONTOUR, already incorporate 
parts of the graphical environment into its structure, such as 
initialization/termination, or the opening/closing of segments. 

To coordinate the interface of the Low-Level routines with a high-level graphics 
package, the user must ensure that an appropriate graphical environment has 
been established. Since the Low-Level routines are designed to operate with an 


5-2 



underlying graphics package, it is convenient to allow the high-level package to 
establish the graphical environment . This may consist of initializing the graphics 
package and appropriate devices, and generating graphical output (possibly 
pausing and clearing the display devices). Then, the user can inquire about 
attributes in the current graphical environment, and invoke the Low-Level 
routines. Note, the user should ensure that any attribute changed by the CGL will 
not affect subsequent use of the high-level package. 


Function 

Subroutine 

— Initialize System 

JBEGIN 

— Initialize Graphics Device 

JDINIT 

— Select Graphics Device 

JDEVON 

Change Defaults 

JDCOLR, JDPEDG,. 

Establish Viewing Transformation 

JWINDO, JVPORT,. 

Open Segment 

JOPEN.JROPEN 

Insert Primitives 

JDRAW,... 

Change Attributes 

JCOLOR, JPEDGE. 

Close Segment 

JCLOSE. JRCLOS 

Pause 

JPAUSE 

New Frame Action 

JFRAME 

— Deselect Graphics Device 

JDEVOF 

— Terminate Graphics Device 

JDEND 

— Terminate System 

JEND 


Figure 5-1 . DI-3000 skeleton program. 


5-3 


5.3 Interfacing with the CGL LEZ Routines 


The CGL LEZ routines provide a high-level abstract user interface incorporating 
the establishment of the graphical environment. The Low-Level routines must be 
called after the user has ensured the graphical environment has been 
established. Thus the Low-Level routines are used to augment the existing 
graphics package capabilities by being called in an appropriate context. 

The LEZ routines are described in the LEZ User’s Guide [G-12]; Figure 5-2 shows 
an LEZ skeleton program. Based on this skeleton, the user should interface the 
Low-Level routines near LEZSHW (i.e., roughly where the high-level graphics 
package generates graphics). 

The critical environmental attributes to be considered include the window and 
viewport extents, primitive attributes (i.e., color, character sizes, etc.), and whether 
the segment is opened. 


Function Subroutine 

Initialize system 
Initialize graphics device(s) 

Select graphics device(s) LEZINI 

Set defaults (LEZ/DI-3000) 

Establish chart as linear/logarithmic LEZLIN/LEZLOG 

Display current chart LEZSHW 

Deselect graphics device(s) 

Terminate graphics device(s) 

Terminate system LEZTRM 


Figure 5-2. LEZ skeleton program. 


5-4 


The values of the window can be set to match the page coordinate area , in which 
the user can invoke the Low-Level routines to draw a chart component (i.e., axis, 
etc.). Or, the window can be set to match the data coordinate area , in which the 
user can display data. In either case, the window will be mapped onto the current 
viewport, and in turn the viewport will determine where the graphical output will 
be displayed in the viewspace (i.e., on the display device). For a complete 
description of mapping see the DI-3000 User's Guide [G-5]. 

In the following example program, the Low-Level routines are used to draw 
additional axes (i.e., a top and right axis - see Figure 5-3). Since the axes are 
components described in terms of page coordinates, the corresponding window 
and viewport are initially set to the LEZ default values as documented in the LEZ 
User's Guide [G-12]. 

Next, the length and origin of the axes are obtained by calling the LEZ inquiry 
routine LEZGET. These values are in terms of the page coordinate system 
common to both LEZ and the Low-Level by the previous calls to the window and 
viewport. 

The graphical segment is then opened, and the Low-Level routines are called to 
generate the axes. Note, the axes are displayed prior to calling LEZSHW, and 
thus before the chart generated by LEZSHW. Since LEZSHW is called next, any 
environmental attributes altered by the Low-Level routines (either DI-3000 or 
CGL) must be restored. Next, the segment is closed, completing the 
augmentation using the Low-Level routines. Finally, LEZSHW is called to 
complete the chart generation. The LEZTRM routine is called to deselect and 
terminate the graphics device(s), and terminate the system. 

The following program illustrates the interfacing of the Low-Level routines with a 
high-level package (i.e., the LEZ routines). 

PROGRAM CDLL1 

C 

C PROGRAM INTERFACING THE LOW-LEVEL ROUTINES WITH THE LEZ ROUTINES. 



CHARACTER TITLE*80 , IAXLBL*80 ,DAXLBL*80 
REAL FREQ(IOO) ,POWER(100) , INDMIN, INDMAX 
DATA (POWER(I),I=1 ,76)/ 

+ 7066.0770323, 313987.5856597, 23005.34014683, 25971.13637497, 





C CONVERT DATA TO BE REPRESENTED AS LOGARITHMIC 
DO 1 1=1 ,100 
FREQ( I ) =LOG1 0 ( REAL( I ) ) 

1 POWER( I)=LOG1 0(POWER( I) ) 



C INITIALIZE GRAPHICS PACKAGE, THEN INITIALIZE AND SELECT DISPLAY DEVICE. 
IDEV=0 

CALL LEZINI ( IDEV ) 



C SET LEZ ATTRIBUTES 
NVALS=1 00 

TITLE® ' P [ BLC ] OWER LEVEL VS. FREQUENCY' 

IAXLBL® ’ F [ BLC ] REQUENC Y, [ ELC ] H [ BLC ] Z ' 

DAXLBL= 1 P [ BLC ] OWER LEVEL' 

INDMIN=LOG1 0 ( 1 . ) 

INDMAX=LOG1 0(100.0) 

DEPMIN=LOG1 0(65.0) 

DEPMAX=LOG1 0 ( 290000 . 0 ) 

IAXTYP=3 

IHLOGI=0 

IVLOGI=0 

INDHV=1 

LINAPP=1 



C CALL LEZLOG (SET LEZ LOG ATTRIBUTES) 

CALL LEZLOG ( FREQ, POWER, NVALS , TITLE, IAXLBL,DAXLBL, INDMIN, INDMAX, 
+DEPMIN , DEPMAX , I AXTYP , IHLOGI , IVLOGI , INDHV, LINAPP ) 

C OUTPUT A NOTE ON THE DISPLAY DEVICE 
CALL LEZNOT( 'CDLL1 ' ,7. ,0.,3,1 ,0) 



C USE LOW-LEVEL ROUTINES TO ADD EXTRA AXES. 

C SET WINDOW AND VIEWPORT TO MATCH LEZ'S DEFAULTS. 

CALL JWINDO(0. ,7. ,0. ,7. ) 

CALL JVPORT (-1.,1.,-1.,1.) 

C GET CURRENT LEZ AXES VALUES 

CALL LEZGETf ' XORIGIN ' , XOR , NVALS , MVALS ) 

CALL LEZGET( 'HAXLEN' ,XLEN, NVALS, MVALS) 

CALL LEZGET( ' YORIGIN' ,YOR, NVALS, MVALS) 

CALL LEZGET( 'VAXLEN' ,YLEN, NVALS, MVALS) 

CALL JOPEN 
C HORIZONTAL AXIS 

CALL JMOVE ( XOR , Y OR+ YLEN ) 

C SEE INDMIN, INDMAX ABOVE FOR THE FOLLOWING VALUES 
CALL CEXP(1 . ,100. ,MINH,MAXH) 

NTICH= ( MAXH-MINH ) + 1 
CALL CHLABJ ( 1 ) 

CALL CHLOGS ( MINH ) 

CALL CHLOGF ( 1 ) 

CALL CHLOG ( XLEN , NTICH , 0 ) 



C RESTORE VALUES FOR LEZ ROUTINES 
CALL CHLABJ(O) 

C 

C VERTICAL AXIS 

CALL JMOVE ( XOR+XLEN , YOR ) 

C SEE DEPMIN ,DEPMAX ABOVE FOR THE FOLLOWING VALUES 
CALL CEXP(65.0, 290000. 0,MINV,MAXV) 

NTICV= ( MAXV-MINV ) + 1 
CALL CVLABJ ( 1 ) 

CALL CVLOGS ( MINV ) 

, CALL CVL0GFO ) 

CALL CVLOG(YLEN,NTICV,0) 

C RESTORE VALUES FOR LEZ ROUTINES 
CALL CVLABJ ( 0 ) 

* CALL JCLOSE 

C 

C GENERATE GRAPHICS OUTPUT FOR THE LEZ ROUTINES 
CALL LEZSHW 

C TERMINATE ALL GRAPHICS 
CALL LEZTRM 


STOP 

END 


10 


% 


10 


10 



In the previous example, the Low-Level routines are called prior to LEZSHW. 
The Low-Level routines could have been called after LEZSHW with a few minor 
adjustments. A call to LEZSHW displays the LEZ graphics output, and by default 
pauses for the viewer. Subsequently, the user hits any key to continue, causing 
the display device to be cleared (i.e., a frame advance). 

Thus, if the Low-Level routines are called after LEZSHW, the use must suppress 
both the pause and the clear performed by LEZSHW, and invoke these 
operations appropriately after performing the desired Low-Level operations. 

The following program is identical to the previous, except now the calls to the 
Low-Level routines are made after LEZSHW. Note, the calls to LEZOPT prior to 
LEZSHW suppress the pause and clear operations. These operations are now 
performed after the calls to the Low-Level routines by calls to the underlying 
graphics package (i.e., JPAUSE and JFRAME). 


PROGRAM CDLL2 


C 

C PROGRAM INTERFACING THE LOW-LEVEL ROUTINES WITH THE LEZ ROUTINES. 
C 


CHARACTER TITLE*80 , IAXLBL*80 ,DAXLBL*80 
REAL FREQ(IOO) , POWER( 1 00) , INDMIN, INDMAX 
DATA (POWER(I) ,1=1 ,76)/ 


+ 7066.0770323, 

+ 23314.47811626, 
+ 6533.280733426, 
+ 1075.542233512, 
+ 990.5827153465, 
+ 185.9121866205, 
+ 90151.05656181, 
+ 19139.27829711 , 
+ 2769.064915013, 
+ 224.6112529072, 
+ 763.2538952391, 
+ 1546.468077257, 
+ 46517.56984878, 
+ 67.7501808438, 

+ 643.2165902202, 
+ 8240.202957789, 
+ 780.321551955, 

+ 13314.08558278, 
+ 8369.70034301, 


313987.5856597, 
16222.72126064, 
6567.484820724, 
2304.552081512, 
1139.692923046, 
6922.275564162, 
32565.81919631 , 
2631 1 .51279586, 
1114.906853713, 
292.8078714839, 
1036.757022708, 
30998.79018191 , 
8264.407149583, 
136.6466583528, 
1824.921600301 , 
4042.516486596, 
869.2380712535, 
42705.82833591 , 
423.4410260173, 


23005.34014683, 

11123.46224798, 

5931 .92717933, 

3938.878376374, 

539.1035104119, 

47871 .80671708, 

3126.25985372, 

18051 .10302768, 

472.3435990609, 

913.1650006148, 

2318.840862193, 

90446.39960755, 

477.4873134733, 

197.6147132091 , 

5246.018888617, 

1615.454279283, 

806.9102907816, 

56933.22987158, 

1721 .308093883, 


25971.13637497, 

8573.673551723, 

3100.185764845, 

2372.668800947, 

186.2399260743, 

101610.8109471 , 

5378.883275207, 

7595.925085295, 

336.5553643497, 

1111.290988571, 

1815.1 15702427, 

99542.65318885, 

82.183079214, 

229.3505457034, 

9355.942325835, 

876.7523693048, 

1417.485863451 , 

34522.64829539, 

3815.021552281/ 


5-8 



DATA ( POWER ( I ) » 1*77 , 1 00)/ 

+ 3096.996818539, 1130.33337685, 351.6629052997, 323.9146852672, 

+ 496.8216394068, 716.3789266813, 707.1830537755, 395.452882063, 

+ 185.9595078555, 349.7278623283, 579.1256929328, 427.7957796537, 

+ 339.4866401359, 404.7726592585, 3303.494231505, 44732.3344563, 

+ 168132.2764905, 259620.2781873, 179647.069922, 51634.19154093, 

+ 4701.338454798, 220.74733211, 377.2257021375, 552.6383507909/ 



C CONVERT DATA TO BE REPRESENTED AS LOGARITHMIC 
DO 1 1=1 ,100 
FREQ ( I ) =LOG 1 0 ( REAL ( I ) ) 

1 POWER(I)=LOG10(POWER(I) ) 



C INITIALIZE GRAPHICS PACKAGE, THEN INITIALIZE AND SELECT DISPLAY DEVICE. 

IDEV=0 

CALL LEZINI ( IDEV) 

C 

C SET LEZ ATTRIBUTES 
NVALS=1 00 

TITLE® 1 P [ BLC ] OWER LEVEL VS. FREQUENCY' 

IAXLBL® 1 F [ BLC ] REQUENCY , [ ELC ] H [ BLC ] Z ' 

DAXLBL® 1 P l BLC ] OWER LEVEL' 

INDMIN=LOG1 0(1 . ) 

INDMAX=LOG1 0(100.0) 

DEPMIN=LOG1 0(65.0) 

DEPMAX=LOG1 0 ( 290000 . 0 ) 

IAXTYP=3 

IHLOGI=0 

IVLOGI=0 

INDHV=1 

LINAPP=1 



C CALL LEZLOG (SET LEZ LOG ATTRIBUTES) 

CALL LEZLOG( FREQ, POWER, NVALS, TITLE, IAXLBL,DAXLBL, INDMIN, INDMAX, 
+DEPMIN , DEPMAX , IAXTYP , IHLOGI , IVLOGI , INDHV, LINAPP ) 

C OUTPUT A NOTE ON THE DISPLAY DEVICE 
CALL LEZNOT( 'CDLL2* ,7. ,0. ,3,1 ,0) 

C 

C SUPPRESS THE LEZ DEFAULTS OF PAUSE AND CLEAR 
CALL LEZOPT( 'PAUSE',. FALSE.) 

CALL LEZOPT( 'CLEAR' , .FALSE. ) 

C GENERATE GRAPHICS OUTPUT FOR THE LEZ ROUTINES 
CALL LEZSHW 



C USE LOW-LEVEL ROUTINES TO ADD EXTRA AXES. 

C SET WINDOW AND VIEWPORT TO MATCH LEZ’S DEFAULTS. 

CALL JWINDO(0. ,7. ,0. ,7. ) 

CALL JVPORT (~1.,1.,-1.,1») 


5-9 



o o o o n o 


C GET CURRENT LEZ AXES VALUES 

CALL LEZGET( ' XORIGIN * , XOR,NVALS,MVALS ) 

CALL LEZGET( ' HAXLEN* , XLEN,NVALS , MVALS) 

CALL LEZGETt ' YORIGIN' ,YOR,NVALS, MVALS) 

CALL LEZGET{ 'VAXLEN' ,YLEN,NVALS, MVALS) 

CALL JOPEN 
C HORIZONTAL AXIS 

CALL JMOVE ( XOR , YOR+YLEN ) 

C SEE INDHIN , INDMAX ABOVE FOR THE FOLLOWING VALUES 
CALL CEXP(1 ,,100.,MINH,MAXH) 

NTICH= ( MAXH-MINH ) + 1 
CALL CHLABJ ( 1 ) 

CALL CHLOGS(MINH) 

CALL CHLOGF ( 1 ) 

CALL CHLOG ( XLEN , NTICH , 0 ) 

C RESTORE VALUES FOR LEZ ROUTINES 
CALL CHLABJ ( 0 ) 


VERTICAL AXIS 

CALL JMOVE (XOR+ XLEN, YOR) 

SEE DEPMIN ,DEPMAX ABOVE FOR THE FOLLOWING VALUES 
CALL CEXP{65.0, 290000.0, MINV,MAXV) 

NTICV= ( MAXV-MINV ) + 1 
CALL CVLABJ { 1 ) 

CALL CVLOGS ( MINV ) 

CALL CVL0GFO ) 

CALL CVLOG ( YLEN , NTICV , 0 ) 

RESTORE VALUES FOR LEZ ROUTINES 
CALL CVLABJ(O) 

CALL JCLOSE 


NOW PAUSE AND CLEAR 

IF(IDEV.GE.1 )CALL JPAUSE(I) 
CALL J FRAME 

c 

C TERMINATE ALL GRAPHICS 
CALL LEZTRM 

C 

STOP 

END 



Power level 


Frequency, Hz 



Power level vs. frequency 


CDLL2 


Figure 5-4. Interfacing the Low-Level routines with a high-level package. 


5-1 1 


Power level 



6. POSTPROCESSING CONSIDERATIONS 


This section gives basic information needed to postprocess plots generated by 
the Low-Level routines. This section also describes what postprocessing 
capabilities are available, and what information is necessary in order to 
interface with the postprocessors. 

Most large-scale, general-purpose graphics packages provide the ability to 
generate and manipulate graphical information in an external file. Thus the 
user can generate interactive plots, and save the equivalent graphical 
representation on a file for later use. However, the ability to postprocess 
depends on a translator to convert the external file information into appropriate 
instructions to drive the physical device. Thus the translator can take the same 
external file and plot (or display) it on several different display devices. 

For example, the Low-Level routines use DI-3000 as its underlying graphics 
package, and thus generates external files, called metafiles, which can be 
postprocessed using the Metafile Translator. Thus, DI-3000 provides a device 
independent method of generating plots which can be displayed on several 
different devices (interactive or hardcopy) without the need of major code 
modifications. 

6.1 Postprocessors 

A postprocessor is a separate program that reads a metafile, performs various 
operations on the file, and formats the data to a file that can be used to drive the 
specified graphics plotting device. 

The Metafile Translator is a plot postprocessor which is useful for previewing 
and editing of metafiles. The Metafile Translator is documented in the Metafile 
User's Guide [6]. The Metafile Translator instructions allow more flexibility in 
how the metafile may be displayed. 

A special form of the Metafile Translator is the PLOT control statement which is 
available on the ACD central computers (CDC/NOS). The PLOT statement is 
documented in the ACD static plotter device driver manual [7]. 


6-1 



6.2 DI-3000 Concepts as Related to Static Plotters 


Certain postprocessing limitations exist and may need to be addressed. First, 
the availability of the devices is installation dependent, and the supported 
device drivers may further restrict this accessibility. Second, each device has 
inherent limitations (such as color, selective erase, and so forth), and these 
device dependent characteristics can have a major impact on the resultant 
output. Most notably, special considerations are needed to ensure that proper 
sizing or scaling is consistent between the constructed image and the plotted 
image. Specific information for devices are given in the device driver manuals 

17]. 

The plotters vary in the quality and types of plots that are generated. The pen 
plotter provides smooth lines but limits the available colors. The pen plotter will 
also allow for varying the thickness of a line. The electrostatic plotters offer 
limited line thickness and also may not generate smooth curves because of the 
pixel resolution. This non-smooth problem is usually eliminated by generating 
larger plots and then having them reduced. 

6.3 Distortion and Scaling 

The user can request that a metafile be generated by calling the appropriate 
underlying graphics package routines (as mentioned in Section 1.2.2, and as 
shown in several examples in Section 3). In order to postprocess this metafile, 
the user should know the dimensions used to draw the image. The user is 
responsible for requesting the appropriate dimensions of the plotter, typically by 
matching the metafile's aspect ratio. All of the plotters regard a metafile's 
aspect ratio as its height to width (determined by the viewspacel . Proper 
information will ensure: 

a compatible aspect ratio between the page size and the device 
coordinate system. For example, a plot generated in a 7 by 7-inch 
page size should be plotted in an area of equal (square) aspect 
ratio to avoid distortion. 

the scaling to be performed from the world coordinate to device is 
consistent (e.g., a 7 by 7-inch plot is sent to a plotting device 
and will be plotted on a 7 by 7-inch region). 


6-2 




The page size is set by a call to CVSPAC, which ensures that the Low-Level 
routines of the CGL will establish the largest viewspace corresponding to the 
desired page size, and thereby a consistent relationship between the page size 
and the underlying virtual coordinates. However, the user must ensure that the 
postprocessor aspect ratio coincides with the viewspace. The NGS software 
defaults to plot in the largest possible square on a given device. This ratio may 
be changed to meet specific needs. Since each plotter uses a different frame 
size, the physical dimensions of the square varies between devices. The 
COMMON GRAPHICS LIBRARY offers routines which support commonly used 
aspect ratios, such as page size, and also allows the user the capability of 
setting an aspect ratio to meet specific requirements. 

Since there are no default world coordinates in the Low-Level routines, the user 
must establish them,- preferably through CVSPAC. For example, a call to 
CVSPAC with the values (7. ,7.), would establish a world coordinate system of a 
7 by 7-unit region (e.g., possibly inches). This implies the aspect ratio is 1. To 
avoid distortion, the user should select a plotter aspect ratio of 1 . For example: 

PLOT. CAL, 11 (HEIGHT=7 . , WIDTH=7 . ) 

or 

PLOT . CAL , 1 1 ( HE IGHT=1 1 . , WIDTH=1 1 . ) 

The first plot instruction will plot the image on the CalComp 11" plotter in a 7 by 
7-inch region (matching identically with the image area). The second plot 
instruction will plot the image in an 11 by 11 -inch region (proportionally 
enlarging all objects). 

6.4 Visual Characteristics 

Because of the variations in plotter characteristics, the user should try to use 
only enough colors to specifically address the plots needs. If monochrome 
copies are to be made, then line patterns and fill patterns should be clear 
enough so that the contents of the chart are distinguished easily by the reader. 
Care should also be taken to ensure that text is properly positioned on the page 
and is of sufficient size that it is legible. The text should be bold enough so that 
it may be copied by a photocopy device without losing any portion of a 
character. Viewgraphs should contain characters large and bold enough to be 
seen across a dark room. All of these items require planning in the design of a 
plot. Fortunately for the user, there are usually consistent requirements. Once 
the appropriate technique is selected, most plots will conform to standards, thus 
resulting in little or no change to the user's plot program. 


6-3 



APPENDIX A 


Description of the Low-Level Routines 


The Low-Level routines are described in detail on the following pages. The 
following information is provided for each routine: 

Subroutine Name: The subroutines are listed in alphabetical order. 


Purpose: 

Use: 

Restrictions: 

Notes: 

Errors: 


A brief description of what the routine is used for. 

The structure of how to call the routine. Also a list of the 
parameters for that routine with a description of what they are 
and the types of values they accept. 

A list of restrictions on the values passed to the parameters or 
on the use of that routine. 

Any further information that the user might have need to 
know. 

A list of errors which may be produced by the routine. The 
error message will indicate the routine which reported the 
error, and a brief description of the cause of the error. 
Typically, the message will be followed by the method of 
recovery the routine used (i.e., routine not executed, the 
default value used, etc.). 


A-1 


Description of the Low-Level Routines 


CARROW 


Draw a Line between 2 Points (with an Arrow Head at an End) 

A-4 

CBEGIN 


Initialize Values used by the CGL 

A-6 

COEBUG 


Change the Low-Level Debug Level 

A-7 

CDREXP 


Convert FORTRAN to Standard Scientific Notation 

A-8 

CEUPS 


Plot an Arc of an Ellipse Centered at Current Point 

A- 1 0 

CERROR 


Set the Error Level of the Low-Level Routines 

A- 1 2 

CEXP 


Determine the Exponent for Log Base 1 0 Min/Max Values 

A- 1 3 

CFILES 


Change the Output Destination of Various Processes 

A-1 4 

CFLIP 


Offset an Array about a Reflection Point (2D) 

A-16 

CGRID 


Draw a Linear Grid (with or without Blank Areas) 

A-1 8 

CGTEXP 


Convert Exponential Value to a Character String 

A-21 

CGTSTR 


Convert a Numeric Value to a Character Value 

A-22 

CHAXIC 


Draw a Horizontal Axis with Character Labels 

A- 23 

CHAXIS 


Horizontal Numeric Axis Routine 

A-25 

CHBTIC 


Set Position of Horizontal Axis Label Tick Marks 

A-27 

CHEXP 


Computes Minimum and Maximum Exponents 

A-28 

CHLAB 


Describe Text and Attributes of Horizontal Axis Label 

A-29 

CHLABJ 


Set Position of Axis Label Relative to Horizontal Axis 

A-30 

CHLOG 


Draw a Horizontal Log Axis 

A-31 

CHLOGF 


Set Horizontal Axis Power of 1 0 

A-34 

CHLDGS 


Set the Initial Power for the Horizontal Log Axis Labels 

A-35 

CHMTIC 


Set the # of Horizontal Minor Tick Marks between Major 

A-36 

CHNMBR 


Draw a Numeric Value using DI-3000 Text Attributes 

A-37 

CHPREC 


Set Horizontal Numeric Axis Tick Mark Label Precision 

A-38 

CHTICJ 


Set the Tick Mark Position Relative to the Horizontal Axis 

A-39 

CHTROT 


Set Angle of Rotation of Horizontal Axis Tick Mark Labels 

A-40 

CKEYIN 


Initializes Key Routines for the CGL 

A-4 1 

CKEYIB 


Label the Key 

A-43 

CKEYPL 


Plot the Key 

A-44 

CKEYTC 


Flag to Set Key Text to Normal or Color of Key Symbol 

A-49 

CKLPLN 


Set Key Line Pattern Length 

A-50 

CLABP 


Set the Size of the Minor Tick Marks as a % of Major 

A-5 1 

CLEAF 


Set Interleave Factor 

A-52 

CLGRID 


Draw Log-Log, Semi-log or Linear Grid 

A-53 

CLNPAT 


Set Line Pattern for NASA Standard Line Patterns 

A-56 

CLNPLT 


Draw a Line between and/or Draw NASA Standard Symbol 

A-57 

CMAGFL 


Set Magnification Factor of Line Pattern 

A-60 

CMNMX 


Find the Minimum and Maximum of an Array 

A-6 1 

CNASA 


Draw NASA LOGO 

A-62 

CNOTE 


Output a Graphics String Rotated by an Angle 

A-65 

CPBCOL 


Set Distance Between Columns in the Key 

A-66 

CPBLIN 


Set Horizontal Distance Between Lines in the Key 

A-67 



CPBXVL 


Return X World Coordinates for X Inches 

A-68 

CPBWL 


Return Y World Coordinates for Y Inches 

A-69 

CPDKEY 


Set Margins for the Four Sides of the Key 

A-70 

CPLGRD 


Draws a Polar Grid 

A-71 

CPLTST 


Send a Message to the Plotter Operator 

A-73 

CPLTYP 


Set Code for Plot Type 

A-74 

CPNTPT 


Draw a NASA Symbol at the Specified Location 

A-75 

CREXP 


Return the Integer Value between '[BSIIPJ* And ’(ESUP)'. 

A-77 

CRLINT 


Set Real to Integer Conversion Flag 

A-78 

CSC ALE 


Determine Publication Quality Axis Attributes 

A-79 

CSET 


Set Common Graphics Library (CGL) Attributes 

A-80 

CSETBP 


Set the Base/Plane Vectors for an Angle of Rotation 

A-85 

CSTRG 


Output Graphics Text 

A-86 

CSTRIP 


Find Indices for the First and Last Non-blank Character 

A-87 

CSYMNO 


Set the Type of Symbol 

A-88 

CSYMSZ 


Set Size of Symbol 

A-90 

CTCOL 


Set Text Color for CGL Graphics Text 

A-9 1 

CTODX 


Convert Degrees to a Vector Related Value 

A-92 

CTPREC 


Set Text Precision for CGL Graphics Text 

A-93 

CVAXIC 


Draw a Vertical Axis with Character Labels 

A-94 

CVAXIS 


Vertical Numeric Axis Routine 

A-96 

CVBTIC 


Set Position of Vertical Axis Label Tick Marks 

A-98 

CVJUST 


Set Position of Vertical Axis Label (Horizontal/Vertical) 

A-99 

CVLAB 


Describe the Text and Attributes of Vertical Axis Label 

A- 1 00 

CVLABJ 


Set Position of Axis Label Relative to Vertical Axis 

A- 1 01 

CVLOG 


Draw a Vertical Log Axis 

A- 1 02 

CVUOGF 


Set Vertical Log Axis Raised to a Power of 10 

A- 1 05 

CVLOGS 


Set the Initial Power of the Vertical Log Axis Label 

A- 1 06 

CVMTIC 


Set the Number of Vertical Minor Tick Marks between Major 

A-1 07 

CVPORT 


Defines a Viewport into the Virtual Coordinates by DI-3000 

A-108 

CVPREC 


Set Vertical Numeric Axis Tick Mark Label Precision 

A- 1 09 

CVSPAC 


Establish DI-3000 Boundaries for an Entire Frame 

A-1 10 

CVTICJ 


Set the Tick Mark Position Relative to the Vertical Axis 

A-1 1 1 

CVTROT 


Set Angle of Rotation for Vertical Axis Tick Mark Labels 

A-1 12 

CXCALC 


Returns Equivalent Delta X Value for a Given Delta Y 

A-1 13 

CYCALC 


Returns Equivalent Delta Y Value for a Given Delta X 

A-1 14 

C1NMBR 


Draws a Numeric Value Using Text Precision 

A- 1 1 5 

C2NMBR 


Draws a Numeric Value Using Character Precision 

A-1 16 

C3NMBR 


Draws a Numeric Value Using Stroke Precision 

A- 1 1 7 



CARROW - Draw a Line between 2 Pts (with an Arrow Head at an End) 


FORTRAN 77 

To draw a line between two points starting at the 
point (AX, AY) and ending at the point ( BX , BY ) . An 
arrow head of ITYPE is drawn at point (AX, AY). The 
final pen position is set to point ( BX , BY ) . 

CALL CARROW ( AX , A Y , BX, BY, ALNGTH, ITYPE) 

AX, AY - Starting coordinates of the line, 
type : REAL 

BX,BY - Ending coordinates of the line, 
type : REAL 

ALNGTH - Length of the arrow head, 
range: greater than 0. 
type : REAL 

ITYPE - Type of arrow head, 
range: 0 to 5. 
type : INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: line attributes, polygon attributes. 

2) CGL attributes: None. 

RESTRICTIONS : 

1) AX, AY cannot equal BX , BY . 

2) Segment must be open. 

ERRORS : 

CARROW: THE RANGE OF ALNGTH IS .GT. 0 

ATTEMPTED TO PASS IN ALNGTH = alngth 
THIS ROUTINE IS NOT EXECUTED. 

CARROW: THE RANGE OF ITYPE IS 0 TO 5 (INTEGER). 

ATTEMPTED TO PASS IN ITYPE = itype 
THIS ROUTINE IS NOT EXECUTED. 

CARROW: BOTH (BX=AX) AND ( BY=AY ) CAN"T BE TRUE. 

THE ROUTINE IS NOT EXECUTED. 


LANGUAGE: 

PURPOSE: 

USE: 


NOTE: Arrowheads set to ITYPE of 3,4,5 are drawn as polygons, and 
therefore can be solid filled. 


A - 4 



CBEGIN - initialize Values used by the CGL 


LANGUAGE: FORTRAN 77 

PURPOSE: Initialize vilues used by the CGL. 


USE: 


CALL CBEGIN 


ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: None. 

2) CGL attributes: None. 


RESTRICTIONS: 1) Must be called prior to using other CGL 

routines. If this routine is not called, 
uninitialized variables may cause unpredictable 
results. The invocation of this routine is 
functionally independent of DI-3000, and can thus 
be called anywhere, anytime. However, subsequent 
invocations will reset any user defined CGL 
attributes. 

ERRORS : none . 


EXAMPLE: PROGRAM MAIN 


C Initialize DI-3000 
CALL JBEGIN 
CALL JDINIT(IDEV) 

CALL JDEVON { IDEV ) 

C Initialize COMMON GRAPHICS LIBRARY (CGL) 
CALL CBEGIN 


A - 6 


CDEBUG - Change The Low-Level Debug Level 


LANGUAGE: FORTRAN 77 

PURPOSE: Change the Low-Level debug level. 

USE: CALL CDEBUG ( IDBLVL) 

WHERE: IDBLVL - The debug level. 

0 - Debugging turned OFF. (default) 

1 - Debugging turned ON for 

user-callable routines. 

2 - Debugging turned ON for 

user-callable and internal routines, 
type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI- 3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS : none . 

ERRORS : 

CDEBUG: INVALID ARGUMENT IN CDEBUG. 

IDBLVL SHOULD BE AN INTEGER 0,1 OR 2. 

IDBLVL NOT CHANGED, CURRENT VALUE * idblvl 

NOTES: See CFILES for the file name and associated logical 

unit where the debugging information is written. 


A - 7 



CDREXP - Convert FORTRAN to Standard Scientific Notation 


FORTRAN 77 

This routine converts the FORTRAN exponent 
notation to standard scientific notation. If a REAL 
zero value is input as '.O' it will be returned as 
•'0.0'. Thus, the routine only reformats a value, as 
opposed to recomputing it. 

This routine also puts in the DI-3000 graphics 
art precision text notation for the superscripts of 
an exponent (if one is needed) . If no exponent is 
needed, the number is returned as specified by NDIGIT 
on the call statement. 

CALL CDREXP ( CNMIN, NUMIN, NDIGIT , CNMOUT , NUMOUT ) 

where: CNMIN - Character array containing FORTRAN 
notation exponent, 
type: CHARACTER 

NUMIN - Number of characters in CNMIN 
type: INTEGER 

NDIGIT - Number of digits to precede 
(to the left of) the decimal 
point. 

type: INTEGER 

CNMOUT - Character array containing scientific 
notation exponent, 
type : CHARACTER (returned) 

NUMOUT - Number of characters in CNMOUT. 
type: INTEGER (returned) 

ASSOCIATED ATTRIBUTES: 

1 ) DI-3000 attributes: none. 

2) CGL attributes: 

NRLINT - REAL to INTEGER conversion flag 

.TRUE. - REAL value is plotted as an INTEGER 
.FALSE. - REAL value is plotted as a REAL (default) 
Type: logical 

RESTRICTIONS: 1) The maximum number of characters for CNMIN is 

18. The maximum number of characters for CNMOUT 
is 34. CNMOUT will contain DI-3000 text mnemonics 
to represent superscripts. 

ERRORS : 

CDREXP: NUMIN IS NOT OF INTEGER TYPE. 

ATTEMPTED TO PASS IN NUMIN = numin 
THIS ROUTINE IS NOT EXECUTED. 

CDREXP: NDIGIT IS NOT OF INTEGER TYPE. 

ATTEMPTED TO PASS IN NDIGIT = ndigit 


LANGUAGE: 

PURPOSE: 


USE: 


A - 8 



THIS ROUTINE IS NOT EXECUTED 


EXAMPLE: 


CALL CDREXP( ' ?? ' , 2 , 2 ,CNMOUT,NUMOUT) 

(* CNMOUT WILL = '???????', AND NUMOUT WILL 



CELIPS - Plot an Arc of an Ellipse Centered at Current Point 


LANGUAGE: FORTRAN 77 

PURPOSE: To plot an arc of an ellipse centered at 

current point. Since the arc may not be 

a closed line segment, the DI-3000 polygon 
is not used (i.e., not solid filled). 

USE : CALL CELIPS ( A , B , ALPHA , THET AO r THETAF ) 

A - Length of the semi-major axis 

(world coordinates), 
type: REAL 

B - Length of the semi-minor axis 

(world coordinates)* 
type : REAL 

ALPHA - Anqle of orientation of the major axis. 

This angle is measured from the horizontal 
to the major axis. Counter-clockwise is 
defined as positive direction, 
type : REAL 

THET AO- Starting angle between radius vector 
and major axis, 
type: REAL 

THETAE- Final angle between radius vector 
and major axis, 
type: REAL 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: line attributes. 

2) CGL attributes: None. 

RESTRICTIONS: 1) If THETAO=THETAF, then no ellipse is generated. 

2) Segment must be open. 

NOTES: Since the arc may not be a closed line segment, 

the DI-3000 polygon is not used (i.e., not 
solid filled ) , 

ERRORS : none. 


A 


10 


o o 0 0 


Figure illustrating ellipses. 


A - 11 



CERROR - To Set the Error Level for the Low-Level Routines 


LANGUAGE: FORTRAN 77 

PURPOSE: To set the error level for the Low-Level routines. 

USE: CALL CERROR ( I ERLVL) 

WHERE: I ERLVL - The error level. 

0 - Erroring checking disabled. 

1 - Erroring checking enabled for 

Low-Level ("C"-level) routines, 
(default) 

2 - Erroring checking enabled for 

level 1 and all internal routines, 
type: INTEGER 


ERRORS : 

CERROR: INVALID ARGUMENT IN CERROR. 

I ERLVL SHOULD BE AN INTEGER 0, 1, OR 2. 

I ERLVL NOT CHANGED, CURRENT VALUE = ierlvl 

NOTES: Error level 2 (internal routines) is not intended for users, 

but for internal debugging of the CGL. 



CEXP 


Determine the Exponent for Log Base 10 Min/Max Values 


% 


€ 


LANGUAGE: FORTRAN 77 


PURPOSE: 


USE: 


Determine the exponent for log base 1 0 of a minimum 
and maximum value* The resultant exponent for the 
minimum value will be such that: VMIN >= 10.**MINEXP. 

The resultant exponent for the maximum value will such 
that: VMAX <= 1 0 . * *MAXEXP . 


EXAMPLE: 

VALUE 

MINEXP 

MAXEXP 

.01 

-2 

-2 

.05 

-2 

-1 

.1 

-1 

-1 

.5 

-1 

0 

1 .0 

0 

0 

1 .5 

0 

1 

9.5 

0 

1 

10.5 

1 

1 

15.0 

1 

2 

100.0 

2 

2 

105.0 

2 

3 

CALL CEXP ( VMIN , VMAX/ 

MINEXP , MAXEXP ) 



where : 
VMIN 

VMAX 

MINEXP 

MAXEXP 


Minimum value 
type : REAL 
Maximum value 
type : REAL 

Log 10 exponent for VMIN (returned) 
type: INTEGER 

Log 10 exponent for VMAX (returned) 
type: INTEGER 


ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none* 

2) CGL attributes: none. 


RESTRICTIONS: 1) VMIN and VMAX must be greater than zero* 

ERRORS • 

CEXP: INVALID VALUE FOR VMIN OR VMAX. 

VMIN , VMAX = vmin,vmax 

VALID RANGE IS REAL GREATER THAN ZERO. 

MINEXP , MAXEXP RETURNED AS ZERO. 


A - 13 



CFILES - Chanqe The Output Destination Of Various Processes 


LANGUAGE: FORTRAN 77 

PURPOSE: Change the output destination of various processes. 

This routine opens a file, denoted by the logical unit 
LUN and file name of CFILE. 

USE: CALL CFILES ( ICODE , LUN , CFILE) 

WHERE: ICODE - Specifies the process to be changed. 

1 - Error processing. 

2 - Debug processing. 

3 - Internal processing (LEZLIN/LEZLOG) . 
type: INTEGER 

LUN - Output logical unit. 

Must be an integer greater than 0. 
Logical units are MACHINE DEPENDENT, 
type: INTEGER 

CFILE - Output file descriptor. 

CFILE declared internally as size of 20. 
Valid file names are MACHINE DEPENDENT, 
type: CHARACTER 

NOTES: The files are opened with: 

"OPEN ( UNIT=LUN , FILE=CFILE , STATUS=UNKNOWN " ) . 

All other file attributes use MACHINE defaults. 

Both LUN and CFILE must be valid before files are 
processed. 

ERRORS : 

CFILES: INVALID ARGUMENT IN CFILES. 

ICODE MUST BE AN INTEGER 1,2, OR 3. 

NO CHANGE HAS BEEN MADE. 

CFILES: INVALID ARGUMENT IN CFILES. 

LUN SHOULD BE AN INTEGER GREATER THAN 0. 

NO CHANGE HAS BEEN MADE. 

CFILES: INVALID ARGUMENT IN CFILES. 

CFILE IS INVALID. 

NO CHANGE HAS BEEN MADE. 

CFILES: LUN=lun WAS ASSIGNED TO "fn". 

REASSIGNED TO "jfile" . 

CFILES: ERROR DURING OPEN. 

ICODE, LUN, CFILE= icode, lun, "cf ile" . 

FILE NOT PROCESSED. 


- 14 


A 


CFILES : ERROR DURING INQUIRE. 

ICODE , LUN , CFILE= icode,lun, “cfile" 
FILE NOT PROCESSED. 


CFLIP - Offset an Array about a Reflection Point (2D) 


FORTRAN 77 

Subroutine to offset an array about a reflection point. 
Specifically, offset each element of array A, by 
an equal distance (of that element), on the opposite 
side of a point of reflection (REFLEC). 

CALL CFLIP( A,N, REFLEC ) 

Where: A - Hie array to be examined and transformed. 

Type: REAL 

N - Number of elements in array A. 

Type: INTEGER 

REFLEC- Point about which to invert data. 

Type: REAL 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: 1) N must be 2 or greater. 

Discussion: 

This routine was written to map elements of an 
array into the corresponding mirror image. One 
purpose of this would be to plot data in 
decreasing order. 

Example: Given a minimum and maximum of 100 to 200, 

the elements of an array must be adjusted 
in order to plot them on an axis decreasing 
from 200 to 100. 

Plot data in a world represented by 200... 100. 

The input required would consist of the array 
to be adjusted, the size of the array, and in 
this example, the point of reflection (150). 

More specifically, 1 00+( ( 200-1 00) /2 .) , or more 
generally, MINIMUM+( (MAXIMUM-MINIMUM) /2 . ) . 

This presupposes that the world coordinate system 
will be inverted by mapping MAXIMUM. . .MINIMUM, to 
MINIMUM. . .MAXIMUM (as shown above). 

Thus, given an array A to be plotted from 200 to 100, 
CALL JWIND0 (100,200, YMIN , YMAX ) 

CALL CFLIP(A,N, REFLEC) 

<plot data> 


LANGUAGE: 

PURPOSE: 

USE: 


Note: to return data to original values, apply 
CFLIP to the adjusted data (”unflip M ). 

(i.e., f lip(f lip(A) ) == A). 

A detailed example can be found in Appendix B of the 
CGL Low-Level User’s Guide. 

ERRORS : 

CFLIP: N IS NOT OF INTEGER TYPE. 

ATTEMPTED TO PASS N = n 
THIS ROUTINE IS NOT EXECUTED. 




t 


% 


% 


A 


17 



CGRID - Draw a Linear Grid (with or without Blank Areas) 


LANGUAGE: 

PURPOSE: 

USE: 


FORTRAN 77 

Draw a linear grid over a specified plotting area 

with a rectangular or square area(s) remaining blank. 

CALL CGRID ( X , Y , XS , YS , NOINCX , NOINCY , BLANK, NBLANK ) 

where 

X , Y - The lower left corner of grid in world 
coordinate units, 
type: REAL 

XS - The increment in world coordinate units 

between vertical grid lines, 
range: qreater than 0, but less than 4000. 
type: REAL 

YS - The increment in world coordinate units 

between horizontal grid lines, 
range: greater than 0, but less than 4000. 
type: REAL 

NOINCX - The number of increments along the X-axis, 
range: greater than 0. 
type: INTEGER 

NOINCY The number of increments along the Y-axis, 
range: greater than 0. 
type : INTEGER 

BLANK - An array containing the coordinates of the 
rectangular or square blank area(s). 

The user is responsible for supplying an 
array containing the corner points of 
the blank areas, and the corresponding number 
of blank areas, 
type : REAL 


The first blank, area: 
BLANK ( 1 ) contains 

X 

lower 

BLANK ( 2) 

contains 

Y 

lower 

BLANK! 3) 

contains 

X 

upper 

BLANK! 4) 

contains 

Y 

upper 

For the second blank 

area : 

BLANK! 5) 

contains 

X 

lower 

BLANK! 6) 

contains 

Y 

lower 

BLANK! 7) 

contains 

X 

upper 

BLANK! 8) 

contains 

Y 

upper 


left coordinate 
left coordinate 
right coordinate 
right coordinate 

left coordinate 
left coordinate 
right coordinate 
right coordinate 


NBLANK - An INTEGER specifying the number of blank 
areas to be drawn. A maximum of 10 blank 
areas are allowed. 

range: 0 to 10. If NBLANK is 0, then a dummy 
variable should be passed 
for BLANK. 

type: INTEGER 




* 


A - 18 



NOTES : 


To draw a box around the areas, the user 
is required to make the following calls 
immediately before or after the call to ‘'CGRID" : 

CALL JRECT( BLANK (1 , 1 ) , BLANK ( 2 , 1 ) , BLANK ( 3 , 1 ) , BLANK (4, 1 ) ) 
For the 2nd box - 

CALL JRECT( BLANK ( 1 , 2 ) , BLANK { 2,2) ,BLANK(3,2) ,BLANK(4,2) ) 
For the N*th box - 

CALL JRECT( BLANK ( 1 , n ) , BLANK ( 2 , n ) , BLANK ( 3 , n ) , BLANK ( 4 , n ) ) 

ASSOCIATED ATTRIBUTES: 

1) DI- 3000 attributes: line attributes. 

2) CGL attributes: none. 

RESTRICTIONS: 

m 1) The maximum number of boxes is limited to 10. 

2) NOINCX and NOINCY are limited to 4000. 

3) Segment must be open. 

{ ERRORS : 

CGRID: XS MUST BE .GT. 0, BUT LESS THAN tnaxinc. 

ATTEMPTED TO PASS IN XS = XS 
THIS ROUTINE IS NOT EXECUTED. ' 

CGRID: YS MUST BE .GT. 0, BUT LESS THAN maxinc. 

ATTEMPTED TO PASS IN YS = ys 
THIS ROUTINE IS NOT EXECUTED. 

CGRID: NOINCX EXPECTED INTEGER TYPE. 

ATTEMPTED TO PASS IN NOINCX = noincx 
THIS ROUTINE IS NOT EXECUTED. 

CGRID: NOINCY EXPECTED INTEGER TYPE. 

ATTEMPTED TO PASS IN NOINCY = noincy 
THIS ROUTINE IS NOT EXECUTED. 

CGRID: NBLANK EXPECTED INTEGER BETWEEN 0 AND maxbox 

ATTEMPTED TO PASS IN NBLANK = nblank 
m THIS ROUTINE IS NOT EXECUTED. 


A 


19 



CALL CGRIDt X , Y ,XS .YS .NOINCX .NOINCY .BLANK ,NBLNK ) 
X . Y WORLD COORDINATES OF LOWER LEFT PT 
XS INCREMENT BETWEEN X-AXIS GRID LINES 

YS INCREMENT BETWEEN Y-AXIS GRID LINE? 

NOINCX NUMBER OF INCREMENTS ALONG X-AXIS 
NOINCY NUMBER OF INCREMENTS ALONG Y-AXIS 
BLANK COORDINATE ARRAY OF THE BLANK AREAS 
NBLNK NUMBER OF BLANK AREAS 


CGTEXP - Convert Exponential Value to a Character String 


FORTRAN 77 

This routine converts an exponential value to a 
character strinq and returns the number of characters. 
This is needed when plotting exponential values, as 
the actual value to be plotted is converted to display 
code using a FORTRAN 77 internal write. 

CALL CGTEXP ( VALUE , NDEC , CHRNUM , NUM ) 

where: VALUE - Numeric value to be converted, 
type : REAL 

NDEC - Number of significant digits, 
type: INTEGER 

4 CHRNUM- Character string containing the 

numeric value (returned), 
type: CHARACTER 

NUM - Number of characters in CHRNUM. 
up to 18. (returned), 
type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1 ) DI-3000 attributes: none. 

2) CGL attributes: 

NRLINT - REAL to INTEGER conversion flag 

•TRUE. - REAL value is plotted as an INTEGER 
.FALSE. - REAL value is plotted as a REAL (default) 
Type : logical 

RESTRICTIONS: 1) Up to 1 3 significant digits are allowed including 
the decimal point. 

ERRORS : 

^ CGTEXP: NDEC EXPECTED INTEGER TYPE. 

ATTEMPTED TO PASS IN NDEC= ndec 
THIS ROUTINE IS NOT EXECUTED. 


LANGUAGE: 

PURPOSE: 

USE: 


A - 21 



CGTSTR - Convert a Numeric Value to a Character Value 


LANGUAGE: FORTRAN 77 

PURPOSE: This routine converts a numeric value to a character 

value and returns the number of numeric characters 
or digits. 

| USE: CALL CGTSTR ( VALUE , NDEC , CHRNUM , NUM ) 

! 

WHERE: VALUE - Numeric value to be converted. 

Type may be either INTEGER or REAL 

! based on NDEC. 

type: REAL/ INTEGER 

NDEC * If the sign of NDEC is positive (i.e., the 
value of NDEC is 0 or more), then the value 
NDEC specifies the number of digits to the p 

right of the decimal point. If the sign is 
negative, then the value NDEC specifies the 
minimum number of digits, 
type: INTEGER 

CHRNUM- Character string containing the 
numeric value (returned), 
type: CHARACTER ( returned ) 

NUM - Number of characters in CHRNUM. 

Maximum of 13. (returned), 
type: INTEGER (returned) 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: 

NRLINT - REAL to INTEGER conversion flag 

•TRUE. - REAL value is plotted as an INTEGER 
♦FALSE. - REAL value is plotted as a REAL (default) 

Type: logical 

m 

RESTRICTIONS: 1 ) Up to 1 3 significant digits are allowed, including 
the decimal point. 

A, 

ERRORS s 

CGTSTR: NDEC EXPECTED INTEGER TYPE. 

ATTEMPTED TO PASS IN NDEC= ndec 
THIS ROUTINE IS NOT EXECUTED. 

NOTES: A value of 0.0 will be represented as "0" regardless 
of NDEC (i.e., regardless of type, or precision). 

i 


A - 22 



CHAXIC - Draw a Horizontal Axis with Character Labels 


LANGUAGE: FORTRAN 77 

PURPOSE: To draw a horizontal axis with character labels. 

This routine retrieves attributes (DI-3000 and 
CGL) when the subroutine is invoked. 

These axis characteristics remain in force until 
SUBROUTINE CHAXIC is reinvoked. If a horizontal 
axis label is desired, SUBROUTINE CHLAB must be 
invoked prior to this routine. 

USE: CALL CHAXIC ( XLEN , NTIC , CHARA , NLINES f NLABS ) 

XLEN - Length of axis (in world coordinates), 
range: greater than 0. 
type : REAL 

NTIC - Number of tick marks (end tick marks 

inclusive). If NTIC is negative, the major 
and minor tick marks will be suppressed, but 
the tick mark labels will be retained, 
range: IABS(NTIC) must be greater than 1. 
type: INTEGER 

CHARA - Tick mark labels, dimensioned: 

CHARA ( NLINES , NLABS ) . 
type -.CHARACTER 

NLINES - Number of lines in the tick mark labels. 

Range: must be greater than or equal to 0. 
type: INTEGER 

NLABS - Number of labels for the tick marks. 

Range: must be greater than or equal to 0. 
type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: line attributes, polygon attributes. 

2) CGL attributes: 

NHBTIC - Position of horizontal axis label in relation 
to horizontal tick marks. 

0 - labels centered at tick marks, (default) 

1 - labels centered between tick marks. 

type: INTEGER 

NHJUST - Determines if horizontal axis label is written 
horizontally or vertically. 

0 - vertical (default). 

1 - horizontal. 

Type: INTEGER 

NHLABJ - Position of axis label in relation to 
horizontal axis, (above or below) 

0 - horizontal axis label is below axis .( default ) 

1 - horizontal axis label is above axis. 


A - 23 




ORIGINAL PAGE IS 
OF POOR QUALITY 


type: INTEGER 

NHMTIC - Number of minor tick marks between major tick 
marks for the horizontal axis. (default=0) 

Range : INTEGERS greater or equal to 0. 

TYPE: INTEGER 

NHTICJ - A value to indicate positioning of tick marks for 
horizontal axis. 

0 - tick marks are not positioned about the axis 

1 - tick marks positioned right of the axis. 

2 - tick marks positioned to the left of axis. 

3 - tick marks positioned on both sides of axis. 
Default: 1 

Type: INTEGER 

NHTROT - Angle of rotation for horizontal axis tick 
mark labels. 

Type: INTEGER 

RESTRICTIONS: 1) XLEN must be positive. 

2) Segment must be open. 

3) An absolute minimum of two major tick marks. 

4) Axis label can only be horizontal. 

ERRORS : 

CHAXIC : 


CHAXIC : 


CHAXIC: 


CHAXIC: 


CHAXIC: 


HORIZONTAL CHARACTER AXIS 


XLEN EXPECTED VALUE .GT. 0 
ATTEMPTED TO PASS XLEN= xlen 
THIS ROUTINE IS NOT EXECUTED. 

NTIC EXPECTED INTEGER .GT. 1 
ATTEMPTED TO PASS NTIC= ntic 

THIS ROUTINE IS NOT EXECUTED .' 

l ’■»$. v -• *' ' • *" ‘ 

NLINES EXPECTED INTEGER .GE. 0 ' ' 

ATTEMPTED TO PASS NLINES= nlines - v T ’ 

THIS ROUTINE IS NOT EXECUTED. ■ 

. . •• . ../.y .. ' • •• 

.. "■ v • **\* 

NLABS EXPECTED INTEGER .GE. 0 _ . v. • , . • 

ATTEMPTED TO PASS NLABS= nlabs : 

THIS ROUTINE IS NOT EXECUTED. , 

• X >. ' . ' * *> _ . . . , f.-t * r * • • 

TICK MARK ROTATION (NHTROT) ONLY APPLY TO V ’* • 

ONE TICK MARK LINE (NLINES)., ' j ^ f • 

NO ROTATION PERFORMED . . , C 'C". ; : ’ 7 - ; " 

NH=0 ' ■ 


START 


MIDDLE 


END 


HORIZONTAL AXiS LABEL 



ORIGINAL PAGE IS 

or poor quauty 


CHAXIS - Draw a 


Horizontal Axis with Numeric Labels 


LANGUAGE: 


FORTRAN 77 


PURPOSE: 


This routine plots a horizontal numeric axis. The 
numeric values input are calculated, converted to 
characters, then a call to the CHAXIC routine is made 
to do the actual plotting. The attributes used by 
CHAXIC and CHLAB should be considered prior to calling 
this routine. 


USE: 


CALL CHAXIS ( HZMIN , HZMAX, TINCR, HLONG ) 


where: HZMIN - Minimum value used for tick marks 

type : REAL 

HZMAX - Maximum value used for tick marks 
type: REAL 

TINCR - Increment value of tick marks 
type: REAL 

HLONG - Length of axis in current world 
coordinates 
type : REAL 


line attributes, text attributes. 


ASSOCIATED ATTRIBUTES: 

^) DI-3000 attributes: 

2) CGL attributes: • • • . 1 A ;1 "; 

NHBTIC - Position of horizontal axis label in relation 
to horizontal tick marks. 

0 - labels centered at tick marks, (default) 

1 - labels centered between tick marks, 
type: INTEGER 

NHJUST - Determines if horizontal axis^latoe 
horizontally or vertically 

0 - vertical (default) 

1 - horizontal. 




Type : INTEGER 

' . 

NHLABJ - Position of axis label in relatip 
horizontal axis, (above or below) 

0 - horizontal axis label^jis 

1 - horizontal axis label is 

type: INTEGER " . 

NHMTIC - Number of minor tick marks between'major tick 
marks for the horizontal axis. (defaults) 
Range : INTEGERS greater or equal to 0. 

TYPE: INTEGER 



NHPREC - Number of digits to the right of the decimal point 
in the tick mark labels of the horizontal axis. 

<0 - plot as an INTEGER (no decimal point) 



=0 - decimal point only 

>0 - plot as a REAL. Value represents the 

number of digits to the right of 
the decimal point 
Default: -1 

Type: INTEGER 

NHTICJ - A value to indicate positioning of tick marks for 
horizontal axis. 

0 - tick marks are not positioned about the axis. 

1 - tick marks positioned right of the axis. 

2 - tick marks positioned to the left of axis. 

3 - tick marks positioned on both sides of axis. 
Default: 1 

Type: INTEGER 

NHTROT - Angle of rotation for horizontal axis tick 
mark labels. 

Type: INTEGER 

RESTRICTIONS: 1) Tick mark labels always occur at the major tick 
marks (regardless of attribute settings). 

2) If HZMIN is greater than HZMAX , then TINCR must be 
negative. HZMIN and HZMAX cannot be equal. 

3) Segment must be open. 

ERRORS : none . 

NOTES: If HZMIN is greater than HZMAX, then axis labels will 
be output in decreasing order. 


A Title 


I 


o 

o 

V 

2 


.010 r- 

.009 - 
.008 - 
.007 - 
.006 - 
.005 - 
.004 - 
.003 - 
.002 - 
.001 - 
0 - 



6 7 8 9 10 


Horizontal Axis 



CHBTIC - Set Position of Horizontal Axis Label Tick Marks 


LANGUAGE: FORTRAN 77 

PURPOSE: Set position of horizontal axis label tick marks. 

USE: CALL CHBTIC (IV) 

where: IV 

Position of horizontal axis label in relation 
to the horizontal tick marks. 

0 - labels centered at tick marks . (default) 

1 - labels centered between tick marks. 
Type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1 ) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: none. 

ERRORS : 

CHBTIC: INVALID VALUE FOR IV. 

THE RANGE OF nhbtic IS 0,1 (INTEGER). 

ILLEGAL VALUE IS iv 

THE DEFAULT VALUE IS USED. 


L 

A 


AB ABC ABCD ABCDE 

HORIZONTAL LINE 1 


AB ABC ABCD 

HORIZONTAL LINE 1 


A - 27 


CHEXP - Compute Minimum and Maximum Exponents 


LANGUAGE: FORTRAN 77 

PURPOSE: To determine the minimum and maximum value of 

the input data for computing the horizontal 
axis labels, 

USE: CALL CHEXP ( XMIN , XMAX, XBEG , XEND ) 

XMIN - Minimum data value, 

XMAX - Maximum data value, 

XBEG - First tick mark label (returned) . 

XEND - Last tick mark label (returned), 

ASSOCIATED ATTRIBUTES: 

1) DI- 3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS : none . 

ERRORS : none . 


A - 28 


CHLAB - Describe Text and Attributes of Horizontal Axis Label 


FORTRAN 77 

To describe the text and associated attributes 
of the horizontal axis label. 

This routine retrieves attributes (DI-3000 and CGL ) 
when the subroutine is invoked. These label 
characteristics remain in force until SUBROUTINE 
CHLAB is reinvoked. 

CALL CHLAB ( CHARA , NLINE ) 

CHARA(NLINE) - Array of characters for axis, 
type: CHARACTER 

NLINE - Number of lines in label. 

range: integer 0 to 5. 
type: INTEGER 

Associated Attributes: 

1) DI-3000 attributes: line attributes, text attributes. 

2) CGL attributes: none. 

RESTRICTIONS : 

1 ) The number of lines per axis label is limited to 0. 

2) The number of characters per line is limited to 256. 

3) All lines in axis label are single spaced. 

4) Segment must be open. 

5) Horizontal axis label can only be horizontal text. 

NOTES: if NLINE is less than or equal to 0, then all horizontal axis 
label attributes are reinitialized. If NLINE is greater than 
5, then only the first 5 array elements are used. 

ERRORS : 

CHLAB: NLINE MUST BE .GE. 0 

ATTEMPTED TO PASS NLINE= nline 
THIS ROUTINE IS NOT EXECUTED. 


LANGUAGE: 

PURPOSE: 


USE: 


A - 29 


* 



r r i i i i i i m 

CALL CHLABJ(I) 


A - 30 



CHLOG - Draw a Horizontal Log Axis 


« 


LANGUAGE: FORTRAN 77 

PURPOSE: To draw a horizontal log axis. 

This routine retrieves attributes (DI-3000 and CGL) when 
this subroutine is invoked. 

These characteristics remain in force until subroutine 
CHLOG is reinvoked. 

If a horizontal axis label is desired, subroutine CHLAB 
must be invoked prior to this routine. 

USE: CALL CHLOG ( XLEN , NTIC , NHLOGI ) 

XLEN - Length of axis (in world coordinates), 
range: greater than 0. 
type: REAL 

NTIC - Number of tick marks (end tick marks inclusive) 
(i.e., number intervals over XLEN axis). 

If ntic is negative, the major 
tick marks will be suppressed, but the 
numeric tick mark label will be retained, 
range: IABS(NTIC) must be greater than 1. 
type: INTEGER 

NHLOGI- Tick mark labels type. 

The following are the various types : 

0 - No small tick marks. 

1 - 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9,1 

2 - 1 , 2 , 4 , 6 , 8,1 

3 - 1,3, 5, 7, 9,1 

4 - 1,5,1 
5-1,1 

6 - 2 , 3 , 4 , 5 , 6 , 7 , 8, 9 

7 - 2, 4, 6, 8 

8 - 3, 5, 7, 9 
9-5 

If NHLOGI is positive then labels 

and small loq tick marks are drawn. 

If NHLOGI is negative then only small log 
tick marks are drawn, 
type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: line attributes, text attributes. 

2) CGL attributes: 

NHLABJ - Position of axis label in relation to 
horizontal axis, (above or below) 

0 - horizontal axis label is below axis . (default) 

1 - horizontal axis label is above axis, 
type: INTEGER 

NHLOGF - Determine if horizontal axis will have 


A - 31 




major tick marks as 10 raised to a power. 

-1 - major tick mark labels decrease 

0 - no major tick mark labels (default) 

1 - major tick mark labels increase 
TYPE .-INTEGER 

NHLOGS - The initial power for the horizontal log 

axis labels, (i.e., 10 raised to this power) 
(default**)) 

Ranqe : any valid INTEGER. 

Type : INTEGER 

NLABP - The size of the minor tick marks as a percentage 

of the size of the major tick marks. (Default*2/3) 
Range : REAL values greater than 0. 

Type : REAL 

RESTRICTIONS: 1) XLEN must be positive. 

2) Only whole log cycles starting at minor tick mark 
one are generated. 

3) An absolute minimum of two major tick marks. 

4) Segment must be open. 


ERRORS : 

CHLOG: XLEN EXPECTED TO BE .GT. 0 

ATTEMPTED TO PASS XLEN* xlen 
THIS ROUTINE IS NOT EXECUTED. 

CHLOG: NTIC EXPECTED TO BE AN INTEGER. 

ATTEMPTED TO PASS NTIC* ntic 
THIS ROUTINE IS NOT EXECUTED. 

CHLOG: NHLOGI EXPECTED TO BE AN INTEGER. 

ATTEMPTED TO PASS NHLOGI* nhlogi 
THIS ROUTINE IS NOT EXECUTED. 


A - 32 



HORIZONTAL LOG AXIS 


1 2 3 4 5 6 

1 O 5 

HORIZONTAL LOG AXIS LABEL 


7 8 9 1 

1 0 * 


1 ) TO SET AXIS LRBEL 

CALL CHLRBl CHARA ,NL INE ) 

CHARA ARRAY OF CHARACTERS FOR THE AXIS 
NLINE NUMBER OF LINES IN THE AXIS LABEL 

2 ) TO DRAW AXIS AND LABEL 

CALL CHLOGt XLEN .NT I C .NLOGI ) 

XLEN LENGTH OF THE AXIS 

NT I C NUMBER OF MAJOR TIC MARKS 

NLOGI TIC MARK LABEL TYPE 

0 - NO MINOR TIC MARKS 

1 - 1 . 2 . 3 . 4 . 5 . 6 . 7 , 8 . 9.1 

2 - 1 . 2 . 4 . 6 . 8.1 

3 - 1 . 3 . 5 . 7 , 9.1 

4 - 1 . 5.1 

5 -1,1 

6 - 2 . 3 , 4 . 5 . 6 . 7 . 8. 9 

7 - 2 . 4 , 6. 8 

8 - 3 , 5 , 7. 9 
9-5 


A - 33 



CHLOGF - Set Horizontal Axis Power of 10 


FORTRAN 77 

Set horizontal axis power of 10 
CALL CHLOGF(IV) 
where: IV - 

Determine if horizontal axis will have major 
tick marks as 10 raised to a power. 

-1 - Major tick mark labels decrease 

0 - No major tick mark labels (default) 

1 - Major tick mark labels increase 
Type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1 ) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS : none . 

ERRORS : 

CHLOGF: INVALID VALUE FOR IV . 

THE RANGE OF "NHLOGF" IS -1,0,1 (INTEGER). 

ILLEGAL VALUE IS iv 

THE DEFAULT VALUE IS USED. 


LANGUAGE: 

PURPOSE: 

USE: 


2 


J L 

3 4 


J L I 

5 6 7 0 9 1. 

10 4 


1 

10 3 


CALL CHLOGF(I) 


CHLOGS - Set the Initial Power for the Horizontal Log Axis Labels 


FORTRAN 77 

Set the initial power for the horizontal loq axis 
labels . 

CALL CHLOGS (IV) 
where: IV 

The initial power for the horizontal log 
axis labels (i.e., 10 raised to this power) 
(default = 0) 

Range: any valid integer 

Type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS : None . 

ERRORS : 

CHLOGS: INVALID VALUE FOR IV. 

THE RANGE OF ,l NHLOGS ,, IS ANY INTEGER. 

ILLEGAL VALUE IS iv 

THE DEFAULT VALUE IS USED. 


LANGUAGE: 

PURPOSE: 

USE: 


L 

i 

10 3 



1 1 L-J— LJ U 

4 5 6 7 8 9 1. 

10 4 


CALL CHLOGS(3) 


A - 35 




CHMTIC - Set the # of Horizontal Minor Tick Marks between Major 


LANGUAGE: FORTRAN 77 

PURPOSE: Set the number of horizontal minor tick marks between 

major tick marks. 

USE: CALL CHMTIC (IV) 

where: IV 

Number of minor tick marks between major tick 
marks for the horizontal axis. (default = 0) 
Range: Integers greater or equal to zero, 

type: INTEGER 


ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. * 

2) CGL attributes: none. 

RESTRICTIONS : None . 

ERRORS : 

CHMTIC: IV MUST BE AN INTEGER .GE. 0 

ATTEMPTED TO PASS IV= iv 
THE DEFAULT VALUE IS USED. 


M I I I I I I I I I I I I I I I I I I I I I I I I II LL1 


CALL CHMTIC(7) 


A - 36 



CHNMBR - Draw a Numeric Value using DI-3000 Text Attributes 


LANGUAGE: FORTRAN 77 

PURPOSE: This routine draws a numeric value using current 

text attributes, 

USE: CALL CHNMBR ( VALUE , ND EC ) 

where: VALUE - Value to be plotted real or integer, 
type: REAL 

NDEC - Integer specifying number of digits 
to the right of the decimal point. 

^ type: INTEGER 

NDEC = 0 - Decimal point, number digits 
To the right. 

NDEC < 0 - No decimal point, minimum # 

^ of digits in integer value. 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: text attributes. 

2) CGL attributes: none. 

RESTRICTIONS: 1) The number is restricted to a maximum of 12 

significant digits. 

2) Segment must be open. 

ERRORS : 

CHNMBR: NDEC MUST BE AN INTEGER .GT. 0 

ATTEMPTED TO PASS NDEC= ndec 
THIS ROUTINE IS NOT EXECUTED. 


A - 37 




CHPREC - Set Horizontal Numeric Axis Tick Mark Label Precision 


FORTRAN 77 

Set horizontal numeric axis tick mark label precision 
CALL CHPREC (IV) 

Where : 

IV - Number of digits to the right of the decimal 
point in the tick mark labels of the 
horizontal axis 

> 0 - Plot as a real. IV represents the 
number of digits to the right of 
the decimal point 

< 0 - Display as integer (no decimal point) 

* 0 - No trailing digits. 

Default: -1 

type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1 ) DI- 3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS : None . 

ERRORS: 

CHPREC: IV MUST BE AN INTEGER. 

ATTEMPTED TO PASS IV* iv 
THE DEFAULT VALUE IS USED. 


LANGUAGE: 

PURPOSE: 

USE: 


A - 38 


CHTICJ - Set the Tick Mark Position Relative to the Horizontal Axis 


LANGUAGE: FORTRAN 77 


PURPOSE: Set the tick mark positioning relative to the horizontal 

axis. 

USE: CALL CHTICJ(IV) 

WHERE: IV - 

is a value to indicate positioning of tick marks 

0 — No tick marks. 

1 — Tick marks positioned above the axis. 

2 — Tick marks positioned below the axis. 

3 — Tick marks positioned above and below 

the axis. 

TYPE: INTEGER 

ASSOCIATED ATTRIBUTES: 

1 ) Dl-3000 attributes: none. 

2) CGL attributes: none. 


NOTES: Attribute CHTICJ controls the horizontal axis tick mark 
positioning (i.e., above, below,etc.). The attribute 
CHLABJ controls the positioning of the tick mark labels. 


RESTRICTIONS: none. 


ERRORS : 

CHTICJ: IMPROPER ENTRY GIVEN FOR POSITIONING OF TICK 

MARKS. VALUE MUST BE 0, 1, 2, OR 3. 

DEFAULT VALUE IS USED. 


NO TICK MARKS 
CALL CHTCJ(O) 

Mill I 1 | I I 

TICK MARKS ABOVE THE AXIS 
CALL CHTICJ(I) 

I 1 1 1 I 

TICK MARKS BELOW THE AXIS 
CALL CWTICJ(2) 


TICK MARKS ABOVE AND BELOW THE AXIS 
CALL CHTICJ (3) 


HORIZONTAL LINE 1 
CALL CHTROT(O) 


A - 39 




CHTROT - Set Angle of Rotation of Horizontal Axis Tick Mark Labels 


LANGUAGE: FORTRAN 77 

PURPOSE: Set angle of rotation of horizontal axis tick mark label 

USE: CALL CHTROT(IV) 

WHERE: IV - Rotation angle 

TYPE: Integer 

ASSOCIATED ATTRIBUTES: 

1 ) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: 1) Angles are entered in as integer values. 

ERRORS : 

CHTROT: IV MUST BE AN INTEGER. 

ATTEMPTED TO PASS IV= iv 
THE DEFAULT VALUE IS USED 



HORIZONTAL LINE 1 
CALL CHTROT(O) 



HORIZONTAL LINE 1 
CALL CHTROT(45) 


A - 40 


CKEYIN - Initialize Key Related Variables 


LANGUAGE 

PURPOSE: 


USE: 


FORTRAN 77 


Initialize key related variables (i*e., ISTORE and 
KEYCHR). This routine will reset all key related 
variables to their defaults. Thus existing keys 
using these variables will be overwritten. To plot a 
key, use the following sequence of calls to the CGL: 


Initialization 


Label 


Plot key 


- CALL CKEYIN ( . . . . ) 

before constructing the label for 
the first line in the first key. 

- CALL CKEYLB( • • • • ) 

for each line to save off current 
line information to be plotted by 
a call to CKEYPL • 

- CALL CKEYPL ( ) 

once all lines have been created, 
send the key box coordinates and 
plot the key. 


Note: If the same key variables are used for more 

than one plot, all values are valid until 
another call is made to CKEYIN. 


CALL CKEYIN ( ISTORE , KEYCHR , LINES , NCOL , NTLINS ) 


where: ISTORE - Storage array for attributes used by 

the CGL. Must be dimensioned: 

INTEGER { 15, LINES) 
type: INTEGER (returned) 

KEYCHR - Storage array for line labels. 

Line labels may have more than one 
column. If so each column must be 
specified using a delimiter. The 
storage array must be able to handle 
the longest label (s) for any line. 
Must be dimensioned: 

CHARACTER* ? ? KEYCHR (NCOL, LINE ) . 
(where ?? is the largest expected 
character length of all the labels), 
type : CHARACTER ( returned ) 

LINES - Number of lines to be keyed, 
range: greater than 0. 
type : INTEGER 

NCOL - Number of columns in the key. 
ranqe: greater than 0. 
type: INTEGER 

NTLINS - Number of lines to key column 
titles (in CCTLS) to be stored 


A - 41 


in COMMON CKEYDT as NLINS. 
range: greater than or equal to 0 
type: INTEGER 


ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: 1) Only one key may be built at a time per ISTORE and 
KEYCHR. 

ERRORS : 

CJCEYIN: LINES MUST BE AN INTEGER .GT. 0. 

ATTEMPTED TO PASS LINES = lines 
THIS ROUTINE IS NOT EXECUTED. 

CJCEYIN: NCOL MUST BE AN INTEGER .GT. 0. 

ATTEMPTED TO PASS NCOL= ncol 
THIS ROUTINE IS NOT EXECUTED. 

CJCEYIN: NTLINS MUST BE AN INTEGER .GE. 0. 

ATTEMPTED TO PASS NTLINS= ntlins 
THIS ROUTINE IS NOT EXECUTED. 


A - 42 



CKEYLB - Label the Key 


FORTRAN 77 

This routine labels the key for a given line using 
current attributes. 

CALL CKEYLB ( I STORE , KE YC HR , I COD E , L ABEL ) 

where: ISTORE - Storage array for line and symbol 
attributes. (See CKEYIN ) 
type : INTEGER ( returned ) 

KEYCHR - Storage array for line labels. 

type :CHARACTER( returned) (See CKEYIN) 
ICODE - Code deciding what is to be 
used in key. 
type: INTEGER 

= 1 - CGL line only 

= 2 - CGL marker only 

= 3 - CGL marker and line 

= -1 - DI-3000 line only 
= -2 - DI-3000 marker only 
=» -3 - DI-3000 marker and line 
- -4 - Rectangle 

LABEL - Text string for this line, 
type: CHARACTER 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: 1) Storage area arrays should be initialized using 

subroutine CKEYIN. Only one key may be built at a 
time per ISTORE and KEYCHR. 

2) DI-3000 markers are device dependent, therefore 

the height and width are not selectable by the user. 
Any key using DI-3000 markers are only approximate. 
CGL markers and line patterns are preferred, 
approximate (i.e. r CGL markers are recommended). 

3) CKEYLB should be invoked just before or after the 
call to have the line and/or symbol plotted, in 
order to retain the current attributes. 


LANGUAGE: 

PURPOSE: 

USE: 


ERRORS : 

CKEYLB: ICODE MUST BE AN INTEGER .GE. -4 .AND. .LE. 3. 
ATTEMPTED TO PASS ICODE= icode 
THIS ROUTINE IS NOT EXECUTED. 


A - 43 



CKEYPL - Plot the Key 


I 

LANGUAGE: 

PURPOSE: 

USE: 


FORTRAN 77 

To plot the key within the user's box dimensions 
for the CGL routines. This routine uses the variables 
ISTORE and KEYCHR initialized by CKEYIN and set by 
CKEYLB* 

CALL CKEYPL ( I STORE , KEYCHR, CTTL , CCTLS , BPOS ,KPT, JCOL , NHDR) 
where: 

ISTORE - Storage array for line and symbol 
attributes (see CKEYIN). 
type: INTEGER 

A description of ISTORE' s content: 


location: 

01-10 

1 

2 

3 

4 

5 

6 

7 

8 
9 

10 
11-15 
1 1 
12 

13 

14 

15 


description 

DI- 3000 current internal environment 

the current color (J1IGET(5)). 

the current intensity. 

the current line style. 

the current line width. 

the current pen. 

the current polygon edqe style. 

the current polygon interior style. 

the current polygon color index. 

the current polygon intensity index. 

the current marker symbol. 

additional attributes used by CGL. 

CGL marker symbol number. 

marker symbol size. 

plot type. 

line pattern type. 

magnification factor. 


KEYCHR - Character array (See CKEYIN) key lines, 
type: CHARACTER 

CTTL - Character variable contains key title, 
type : CHARACTER 

CCTLS - Character array ( NCOL, NTLINS ) for 

column titles. See CKEYIN for description 
of NCOL and NTLINS. 
type : CHARACTER 

BPOS - Storage array for key box coordinates. 
REAL BPOS (4) (user supplied) 
type: REAL (returned) 


positions for key box: 

BPOS ( 1 ) : X coordinate for specified box corner. 
BPOS ( 2 ) : Y coordinate for specified box corner. 


A - 44 


I 



BPOS ( 3 ) : X coordinate for box center point. 
BP0S(4) : Y coordinate for box center point. 

KPT - Type of box coordinates input, 
type: INTEGER (returned) 

1 - Center point qiven in BPOS ( 3 ) , BPOS ( 4 ) 

2 - Lower left corner in BPOS ( 1 ) , BPOS ( 2 ) 

3 - Lower right corner in BPOS( 1 ) ,BP0S(2) 

4 - Upper left corner in BPOS ( 1 ) , BPOS ( 2 ) 

5 - Upper right corner in BPOS ( 1 ) , BPOS ( 2 ) 

box for key: 

* * 


BPOS ( 3 ) 
. BPOS ( 4 ) 


BPOS ( 1 ) - 

BPOS ( 2 ) * * 

NOTE: **** If the center point is supplied (KPT=1 ) 

the box's two diaqonal points will be 
determined by the key's dimensions, and output 
in BPOS ( 1 ) , BPOS ( 2 ) and BP0S(3) ,BP0S(4) without 
plotting the key. 

JCOL - Array containing the justification codes 
INTEGER JCOL(LCOL) 
type: INTEGER 

for each column. 

1 = left justification 

2 = center justification 

3 = right justification 

NHDR - Code specifying if a key title is given 
type: INTEGER 

0 = no header 

1 = header qiven in CTTL 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: line attributes, text attributes. 

2) CGL attributes: 

NKLPLN - Key line pattern length (in inches). (Defaults.) 
Range : REAL values greater then 0. 

Type: REAL 

NPBCOL - Distance (in inches) between columns and between 
title and the identification column in the key. 
(Default=. 25 ) 

Ranqe : REAL values greater than 0. 

Type: REAL 

NPBLIN - Distance between lines in the key (in inches). 


A - 45 



(Default=.081 ) 

Range : REAL values greater than 0. 

Type : REAL 

NPDKEY - Margins for the 4 sides of the key (in inches). 

(Default=.1 88) 

Range : REAL values greater than or equal to 0. 

Type : REAL 

NSYMSZ - Size of symbol. 

Range : REAL values greater than zero. 

Type : REAL 

RESTRICTIONS : 

1 ) Associated attributes must be described in terms of the current 
world coordinates. The attributes associated with height, width, 
and length, are converted and stored in virtual coordinates. 

2) The DI-3000 marker is device dependent, therefore only an 
approximation of its size is used in CKEYPL's calculations. 

Since the DI-3000 marker cannot be scaled, then if CKEYPL is 
required to rescale, the resultant key output will probably be 
in error. Thus, the use of DI-3000 marker in conjunction with 
CKEYPL is left to the user's discretion. 

3) Segment must be open. 

ERRORS: 

CKEYPL: 


CKEYPL: 


NOTE: **** 


NHDR MUST BE 0 OR 1 . 

ATTEMPTED TO PASS NHDR= nhdr 
THIS ROUTINE IS NOT EXECUTED. 

INVALID VALUE FOR KPT.' 

THE RANGE OF "KPT" [1,5] (INTEGER).' 

ILLEGAL VALUE IS ',KPT 

NO DEFAULT VALUE CAN BE ASSIGNED.’ 

THE ROUTINE IS NOT EXECUTED. ' 

If the center point is supplied (KPT=1) 
the box's two diagonal points will be 
determined by the key's dimensions, and output 
in BPOS(1 ) ,BP0S(2) and BP0S(3) , BPOS(4) without 
plotting the key. 


A - 46 



EXAMPLE: 


See appendix B for an example of generating a key in context. 
The partial program below shows the dimensions of variables, 
and the interrelationship among routines, in key generation. 

PROGRAM CKEYPL1 

PARAMETER (NC0LS=1 ,NTLINS=1 ,NLINS=3 ,NPTS=1 0) 

INTEGER ISTORE (15, NLINS ) 

C HARACTER KEYCHR ( NCOLS , NLINS ) * 1 5 , KEYLAB ( NLINS ) * 1 5 
REAL BPOS ( 4 ) 

DATA ICODE/3, 1,2/, BPOS/3 . ,6. ,0.,0./ 

DATA KEYLAB/ 1 LINE AND MARKER* LINE ONLY* , 'MARKER ONLY'/ 

CALL JBEGIN 
CALL CBEGIN 
CALL CVSPAC ( . • . ) 

CALL JWINDO( . . . ) 

CALL JOPEN 


CALL CKEYIN( ISTORE, KEYCHR, NLINS, NCOLS, NTLINS) 
DO 10 1=1 , NLINS 
CALL CSET( . . . ) 


CALL CKEYLB ( ISTORE , KEYCHR , ICODE , KEYLAB ) 

CALL CLNPLT( . . . ) 

CALL CKEYPL ( ISTORE , KEYCHR , CTTL , CCTLS , BPOS , KPT , JCOL , NHDR ) 


A - 47 




HORIZONTAL LINE ^ 


CKEYPL1: EMBEDDED KEY INVOCATIONS. 


48 


CKEYTC - Set Key Text to Normal or Color of Key Symbol 


LANGUAGE: FORTRAN 77 

PURPOSE: Set key text to normal or color of key symbol. 

USE: CALL CKEYTC (LV) 

WHERE: LV - 

Flag to set key text to normal or color 
•TRUE. - Key text is normal (default). 
•FALSE.- Key text is same color as symbol 
TYPE: Logical 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: none. 

ERRORS : none . 


A - 49 




Trigonometric values 


CKLPLN - Set Key Line Pattern Length 


LANGUAGE: FORTRAN 77 

PURPOSE: Set key line pattern length 

USE: CALL CKLPLN (RV) 

where: RV 

Key line pattern length (world coordinates), 
(default = 1 . ) 

Range: Real values greater than zero. 

Type : REAL 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: none. 

ERRORS : 

CKLPLN: RV MUST BE .GT. 0. 

ATTEMPTED TO PASS RV= rv. 

THE DEFAULT VALUE IS USED. 



A - 50 


CLABP - set the Size of the Minor Tick Marks as a % of Major 


LANGUAGE: FORTRAN 77 

PURPOSE: Set the size of the minor tick marks as a % of major. 

USE: Call CLABP (RV) 

Where: RV - 

The size of the minor tick marks as a 
percentage of the size of the major tick marks. 
(Default=2/3 ) 

Range: Real values greater than zero. 

Type : REAL 


ASSOCIATED ATTRIBUTES: 

1 ) DI- 3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: none. 

ERRORS : 

CLABP: INVALID VALUE FOR RV. 

THE RANGE OF "NLABP" IS .GT. ZERO (REAL). 

ILLEGAL VALUE IS RV 

THE DEFAULT VALUE IS USED. 


A - 51 


CLEAF 


Set Interleave Factor 


LANGUAGE: FORTRAN 77 

PURPOSE: Set interleave factor. Currently, this attribute is 

only used by CLNPLT. 

USE: CALL CLEAF (IV) 

where: IV 

Interleaf Factor 

1 - values are stored sequentially (default) 

2 - values stored in every other location 
N - values stored in every N'th location 

RANGE: INTEGER values greater than zero 
Type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS : none . 

ERRORS : 

CLEAF: INVALID VALUE FOR IV. 

THE RANGE OF 11 NLEAF " IS .GT. ZERO (INTEGER). 

ILLEGAL VALUE IS iv 

THE DEFAULT VALUE IS USED. 

EXAMPLE: given: 

REAL A( 10) 

DATA A/1 .,2. ,3. ,4. ,5. ,6. ,7. ,8. ,9. ,10./ 

then 

CALL CLEAF(I) will allow CLNPLT to access {l.,..,10.} 

CALL CLEAF ( 2) ==> {1.,3.,5.,7.,9. } 

CALL CLEAF(3) ==> { 1 . ,4. , 7. , 1 0. } 

CALL CLEAF ( IV) ==> (ist, 1+iv position, 1+2*iv, etc.} 


A - 52 


CLGRID - Draw Log-Log, Semi-log or Linear Grid 


LANGUAGE: 

PURPOSE: 

USE: 


FORTRAN 77 

To draw a log-log, semi-loq (in either axis) or 

linear grid with rectangular or square area(s) 

remaining blank. 

CALL CLGRID ( XSC,YSC, IXC , IYC, XGS, YGS ,XGI , YGI , 

BLANK, NBLANK) 

XSC loq - Number of units per log cycle for X. 

lin - Total X axis length, 
type : REAL 

YSC log - Number of units per log cycle for Y. 

lin - Total Y axis length, 
type: REAL 

IXC loq - Number of log cycles along X axis, 

lin - -1 must be loaded, 
type: INTEGER 

IYC log - Number of log cycles along Y axis, 

lin - -1 must be loaded, 
type: INTEGER 

XGS log - Starting grid line for X (1.0 To 9.0). 

This also controls ending grid line, 
lin - 0. must be loaded, 
type : REAL 

YGS log - Starting grid line for Y (1.0 to 9.0). 

This also controls ending grid line, 
lin - 0. must be loaded, 
type : REAL 

XGI log - Interval between secondary grid lines 

in each cycle. Interval is doubled 
above 6 primary grid lines for each 
cycle. Each integer grid line must 
also be an interval line. If not, 
interval is modified so this 
condition will be satisfied. 

1 .0 no secondary grid lines 
.5 one secondary grid line 
.25 three secondary grid lines 
-XGI use tick marks not full grid lines 
+XGI use full grid lines 
type : REAL 

lin - Interval between grid lines for entire 
axis. 

-XGI use tick marks not full grid lines 
■f XGI use full grid lines 
type : REAL 

YGI log - Interval between secondary grid lines in 

each cycle. This interval is doubled 
above 6 primary grid lines per cycle. 
Each integer grid line must also be an 


A - 53 




interval line. If not, interval is 
modified so this condition will be met. 

1 .0 no secondary grid lines 
.5 one secondary grid line 
.25 three secondary grid lines 
-YGI use tick marks not full grid lines 
+YGI use full grid lines 

lin - Interval between grid lines for entire 
axis • 

-YGI use tick marks not full grid lines 
+YGI use full grid lines 
type: REAL 

BLANK An array containing the coordinates of 

the rectangular or square blank area(s). 

For the first blank area 

BLANK ( 1 ) - X lower left coordinate 
BLANK ( 2 ) - Y lower left coordinate 
BLANK ( 3) - X upper right coordinate 
BLANK ( 4) - Y upper right coordinate 
For the second blank area 

BLANK ( 5 ) - X lower left coordinate 
BLANK ( 6 ) - Y lower left coordinate 
BLANK( 7 ) - X upper right coordinate 
BLANK ( 8 ) - Y upper right coordinate 
type: REAL 

N BLANK An integer specifying the number of blank 
areas. A maximum of 10 blank areas are 
allowed. 

range: 0 to 10. If N BLANK is 0 f then a dummy 
variable should be passed for 
BLANK. 

type : INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: line attributes, text attributes. 

2) CGL attributes: 

NLABP - The size of the minor tick marks as a percentage 

of the size of the major tick marks. (Def ault=2/3) 
Range : REAL values greater than 0. 

Type : REAL 

NOTES : 

(1) Major tick mark lengths - 

Horizontal axis : current character height. 

Vertical axis : current character width. 

(2) Minor tick mark lengths - 

Major tick mark length*NLABP 

(where NLABP is desired percentage of major tick mark). 


RESTRICTIONS : 

1 ) Segment must be opened. 

2) The routine will first move the pen to 


A - 54 



X=0 and Y=0. Only perpendicular axes 
are allowed (no skewed grids). 

METHOD: For log-grids the cycle size, number of cycles 
and choice of grid lines within each cycle are 
specified independently for each axis. 

For a log cycle, starting grid lines and 
interval between lines are specified. 

This interval is used until primary grid lines over 
six are encountered. Then the interval is doubled. 

For a linear grid, the axis length and 
interval between lines are specified. 

For both linear and log grids, user may choose 

between full grid lines or 0.25-unit 

abbreviated grid lines independently for each axis. 

OTHER CODING INFORMATION 

If repeat interval ,GT. one after doubled, it 
will be set to one. If it is one, the 
repeat interval lines will coincide with 
the integer grid lines. 

ERRORS : 

CLGRID: IXC MUST BE AN INTEGER. 

ATTEMPTED TO PASS IXC= ixc 
THIS ROUTINE IS NOT EXECUTED. 

CLGRID: IYC MUST BE AN INTEGER. 

ATTEMPTED TO PASS IYC= iyc 
THIS ROUTINE IS NOT EXECUTED. 

CLGRID: NBLANK MUST BE AN INTEGER .ge. 0 .AND. .LE. 10. 

ATTEMPTED TO PASS NBLANK= nblank 
THIS ROUTINE IS NOT EXECUTED. 


A - 55 



oo nj o) cn a C/j N) 


CLNPAT - Set Line Pattern for NASA Standard Line Patterns 


FORTRAN 77 

Set line pattern for NASA standard line patterns. 
CALL CLNPAT (NLNP AT) 

NLNPAT Line pattern for NASA standard line 
patterns 

1 Solid line (default) 

2 - 8 NASA dashed patterns 

range: Integer values from 1 to 8 • 

type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: none. 

ERRORS : 

CLNPAT: INVALID VALUE FOR IV. 

THE RANGE OF "NLNPAT'* IS 1 TO 8 (INTEGER). 

ILLEGAL VALUE IS iv 

THE DEFAULT VALUE IS USED. 


LANGUAGE: 

PURPOSE: 

USE: 


LINE PATTERNS 


1 


O 


-O 

-a 


b 

a 

o 


A - 56 



CLNPLT - Draw a Line between and/or Draw NASA standard Symbol 


LANGUAGE : FORTRAN 7 7 

PURPOSE: To draw a line between and/or draw NASA standard 

symbol or to draw continuous dashed line with a 
symbol at the end of a line. 

The characteristics of the line and/or symbols are 
set by defining the appropriate CGL attributes. 

USE: CALL CLNPLT ( X, Y,N ) 

X - X array to plotted (X world coordinates), 
type : REAL 

Y - Y array to plotted <Y world coordinates), 
type : REAL 

N - Number of points to be plotted, 
type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: line and polygon attributes. 

2) CGL attributes: 

NLEAF - Interleave factor for line plots (CLNPLT). 

1 values are stored sequentially (Default) 

2 values stored in every other location. 
Range : INTEGER values greater than 0. 

Type: INTEGER 

NPLTYP - Code for line plot type (CLNPLT). 

Magnitude specifies the alternate points for symbol 
positive for line and symbol plot 
negative for symbol only 

0 for line plot with specified symbol at end 

1 for symbol for each data point and line between 
(default = ^) 

-2 for symbol for every other data point 
-n for symbol for every other n'th data point 
Range : any INTEGER value. 

Type: INTEGER 

NSYMNO - The Type of symbol to be drawn: 

NSYMNO =* 0 no symbol 

1 circle 

2 square (default) 

3 diamond 

4 triangle 

5 right triangle 

6 quadrant 

7 dog house 

8 fan 


A - 57 




9 

long diamond 



10 

house 



1 1 

circle 

with 

plus 

12 

square 

with 

plus 

13 

diamond 

with 

plus 

14 

triangle 

with 

plus 

15 

right triangle 

with 

plus 

16 

quadrant 

with 

plus 

17 

dog house 

with 

plus 

18 

fan 

with 

plus 

19 

long diamond 

with 

plus 

20 

house 

with 

plus 

21 

dot 



22 

plus sign 




If a flag is desired, add 100, 200,. 900 
to NSYMNO, such that: 

1 - symbol 

101 - symbol + upper right line 

201 - symbol + upper left line 

301 - symbol + lower left line 

401 - symbol + lower right line 

501 - symbol + upper right flag 

601 - symbol + upper left flag 

701 - symbol + lower left flag 

801 - symbol + lower right flag 

901 - symbol is solid filled 
Range ; 0 to 22,100 to 122,..., 900 to 922. 

Type: INTEGER 

NSYMSZ - Size of symbol. 

Range : REAL values greater than zero. 

Type: REAL 

NLNPAT - Line pattern for NASA standard line patterns. 

1 solid line (Default) 

2-8 NASA dashed patterns 
Range : INTEGER values between 1 and 8 (inclusive). 
Type: INTEGER 

NMAGFL - Magnification factor of line pattern (CLNPLT) • 

Each element of the selected line pattern is 
multiplied by the value NMAGFL. (Default = 1.0) 
Range : REAL values greater then 0. 

Type: REAL 

NOTE: To draw a line only (i.e., no symbols, nor spaces for symbols) 
set NSYMNO to 0. 

RESTRICTIONS: 1) Segment must be opened. 

2) The latest world coordinate system (See DI-3000‘s 
JWINDO) should be related to the values in the X 
and Y arrays. 


A - 58 



CRUs 


ERRORS : 

CLNPLT: N MUST BE AN INTEGER .GT. 0. 

ATTEMPTED TO PASS N= n 
THIS ROUTINE IS NOT EXECUTED. 

CLNPLT: NLEAF MUST BE AN INTEGER .GT. 0. 

ATTEMPTED TO PASS NLEAF= nleaf 
THIS ROUTINE IS NOT EXECUTED. 


Xyzabc branch 
Resource utilization 



Fiscal year 


A - 59 


CMAGFL - Set Magnification Factor of Line Pattern 


LANGUAGE: FORTRAN 77 

PURPOSE: Set magnification factor of line pattern. 

USE: CALL CMAGFL ( NMAGFL ) 

where: NMAGFL 

Magnification factor of line pattern, 
element of the selected line pattern is 
multiplied by the value of NMAGFL. (Def 
Range: Real values greater than zero, 

type: REAL 

ASSOCIATED ATTRIBUTES: 

1 ) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: none. 

ERRORS : 

CMAGFL: INVALID VALUE FOR NMAGFL. 

THE RANGE OF NMAGFL IS .GT. 0 (REAL) . 

ILLEGAL VALUE IS nmagfl 
THE DEFAULT VALUE IS USED. 


Each 
= 1 .) 


A - 60 



CMNMX - Find the Minimum and Maximum of an Array 


LANGUAGE: FORTRAN 77 

PURPOSE: Subroutine to find the minimum and maximum of an array. 

USE: CALL CMNMX ( A , N , XMIN , XMAX ) 

Where: A - Hie array to be examined. 

Type: REAL 

N - Number of elements in array A. 

Type: INTEGER 

XMIN, 

XMAX - Minimum and maximum values found, 
(returned) 

Type : REAL 

ASSOCIATED ATTRIBUTES: 

1 ) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: 1) N must be 2 or greater. 

ERRORS : 

CMNMX: N MUST BE INTEGER .GT. 0. 

ATTEMPTED TO PASS N= n 

THIS ROUTINE IS NOT EXECUTED. 


A - 61 


CNASA - Draw NASA LOGO 


LANGUAGE: FORTRAN 77 (ANSI) 

PURPOSE: To draw the NASA LOGO. 

The policy governing the use of the NASA LOGO is 
documented in the NASA LANGLEY RESEARCH CENTER 
Management Manual (NMI 1020. 1e paragraph 13.b). 

USE: CALL CNASA ( THETA , HEIGHT , ICOLOR ) 

where - 

THETA : Angle (degrees) of inclination of the 

logo about the current position. 

See the note below for a further 

explanation. 

type : REAL 

HEIGHT : Height of the logo (world coordinates), 

range: greater than 0. 
type : REAL 

ICOLOR : Integer value showing color of NASA LOGO 

polygon fill. 

0 - black 

1 - red 

2 - normal 

3 - complement of normal 
type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

Notes: The angle of inclination (THETA) is applied relative to the 
NASA logo as indicated by the current text justification 
( JJUST) • For example, a current text justification of 2,2 
(center , center ) will rotate the NASA logo about the logo’s 
center-center location. The following figure provides a « 

summary of the text justification. 

1,3 

. 

1,2 NA 

. 

1,1 - 

RESTRICTIONS: 1) Segment must be opened. 

2) HEIGHT must be greater than zero. 

3) The ratio of HEIGHT to width is 1:3.76. 

4) Each logo letter is a polygon with about 244 points. 
Therefore, the user must ensure that the device 
driver can support polygons with that many points. 


2,3 3,3 

. 

2,2 SA 3,2 

. 

2,1 3,1 


A - 62 


ERRORS : 


CNASA: INVALID VALUE FOR ICOLOR. 

THE RANGE OF ICOLOR IS 0,1, 2, 3. 

THE DEFAULT OF 1 (RED) IS USED. 

CNASA: INVALID VALUE FOR HEIGHT. 

THE RANGE OF ••HEIGHT" IS .GT. ZERO. 
THE ROUTINE IS NOT EXECUTED. 



This figure illustrates justification of the NASA Logo about a point. 


A - 63 




A - 64 



CNOTE - Output a Graphics String Rotated by an Angle 


LANGUAGE: FORTRAN 77 

PURPOSE: To output a graphics string STR, rotated about the 

X-axis by ANGLE deqrees. The string is output in the 
precision determined by PREC. 

USE: CALL CNOTE ( STR , ANGLE , PREC ) 

where : 

STR - Graphics string to be output, 
type: CHARACTER ( * ) 

ANGLE - Angle of rotation (degrees), 
type : REAL 

PREC - Type of graphics precision. 

Range : 1 - string precision text. 

2 - character precision text. 

3 - stroke precision text. 

4 - graphics art precision text. 

5 - di-textpro precision text. 
Type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI-300G attributes: none. 

2) CGL attributes: 

NTCOL - Text color. 

Range : 0 or greater (see underlying package). 

Type: INTEGER 


RESTRICTIONS: Segment must be open. 

ERRORS : 

CNOTE: PREC MUST BE AN INTEGER 1 TO 5 . 

ATTEMPTED TO PASS PREC« prec 
THIS ROUTINE IS NOT EXECUTED. 

NOTE: 1) The current character attributes are used (except 
JBASE and JPLANE) • 

2) The vectors for JBASE and JPLANE may be altered. 


A - 65 




CPBCOL - Set Distance Between Columns in the Key 


FORTRAN 77 

Set distance between columns. 

CALL CPBCOL (RV) 
where: RV - 

Distance (in inches) between columns and between title 
and the identification column in the key. (Default® .25) 
Range: REAL values greater than zero. 

Type : REAL 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none, 

2) CGL attributes: none. 

RESTRICTIONS: none. 

ERRORS : 

CPBCOL: INVALID VALUE FOR RV. 

THE RANGE OF "NPBCOL" IS .GT. ZERO (REAL). 

ILLEGAL VALUE IS rv 

THE DEFAULT VALUE IS USED. 


LANGUAGE: 

PURPOSE: 

USE: 



Title 

Title 

o 

Abode 

Klmno 

□ 

Fghij 

UL~_ 

Pqrst 


CPBCOL 


A - 66 



CPBLIN - Set Horizontal Distance Between Lines in the Key 


LANGUAGE: FORTRAN 77 

PURPOSE: Set horizontal distance between lines in the key. 

USE: CALL CPBLIN(RV) 

where: RV - 

Distance between lines (in inches). 
(Default = .081) 

Range: REAL values greater than zero 

Type : REAL 

ASSOCIATED ATTRIBUTES: 

1 ) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: none. 

ERRORS : 

CPBLIN: INVALID VALUE FOR RV. 

THE RANGE OF "NPBLIN" IS .GT. 0. (REAL). 

ILLEGAL VAULE IS rv 

THE DEFAULT VALUE IS USED. 



Title 

Title 

o 

Abcde 

Klmno 

□ 

Fghij 

} — 

Pqrst 


CPBLIN 


A - 67 




CPBXVL - Return X World Coordinates for X Inches 


LANGUAGE : FORTRAN 7 7 

PURPOSE: Determine amount of DI-3000 X world coordinates 

for a given length in X inches, 

USE: VAL * CPBXVL( XINCH) 

where: XINCH - Value in inches, 
type : REAL 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: CVS PAC or CVPORT must be called prior to this routine. 
ERRORS : none . 


A - 68 




CPBYVL - Return Y World Coordinates for Y Inches 


LANGUAGE: FORTRAN 77 

PURPOSE: Determine amount of DI-3000 Y world coordinates 

for a given length in Y inches. 

USE: VAL - CPBYVL(YINCH) 

where: YINCH - Value in inches. 

type : REAL 


ASSOCIATED ATTRIBUTES: 

1 ) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: CVSPAC or CVPORT must be called prior to this routine. 
ERRORS : none . 


A - 69 



CPDKEY - Set Margins for the Four Sides of the Key 


LANGUAGE: FORTRAN 77 

PURPOSE: Set margins for the four sides of the key. 

USE: CALL CPDKEY (RV) 

where: RV - 

Margins for the four sides of the key. 

(Default * .188) 

Range: Real values greater than or equal to 0. 
Type : REAL 

ASSOCIATED ATTRIBUTES: 

1 ) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: none. 

ERRORS : 

CPDKEY: INVALID VALUE FOR RV. 

THE RANGE OF "NPDKEY" IS .GT. 0. (REAL). 

ILLEGAL VALUE IS rv 

THE DEFAULT VALUE IS USED. 



CPDKEY 


A - 70 


CPLGRD - Draw a Polar Grid 


LANGU AG E : FORTRAN 

PURPOSE: To draw a polar grid, which consists of a pair of 

intersecting axes, concentric circles, and tick marks 
on the outer circles. The tick marks can also be 
extended to the origin, thus forming radii. 

USE: CALL CPLGRD ( X, Y,R, TMAJ , TI CD EG ) 

where: 

X, Y - The coordinates of the center of the polar 

grid, 
type : REAL 

R - Length of the radius of the grid, 

range: greater than 0. 
type: REAL 

TMAJ - Length along the axis separating 
concentric circles. 

+ label axis 

- axis not labeled 
range: not equal to 0. 
type : REAL 

TICDEG - The number of degrees between tick marks. 

+ tick mark only 

- tick mark extended to grid origin 
type: REAL 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: line attributes. 

2) CGL attributes: none. 

RESTRICTIONS: - A segment must be open. 

- X, Y, and R are in world coordinates. 

ERRORS : 

CPLGRD; R MUST BE .GT. 0. 

ATTEMPTED TO PASS R= r 
THIS ROUTINE IS NOT EXECUTED. 

CPLGRD: TMAJ CANNOT .E Q. 0. 

ATTEMPTED TO PASS TMAJ= tmaj 
THIS ROUTINE IS NOT EXECUTED. 


A - 71 




90 



270 


A - 72 


CPLTST - Send a Message to the Plotter Operator 


LANGUAGE: FORTRAN 77 

PURPOSE: This routine is used to send a message to the plot 

operator* It is intended for use with static plotters 
operated by the ACD support personnel* 

USE: CALL CPLTST (MESSAGE) 

MESSAGE - is the message for the operator. 

Type : character * ( * ) 


ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: Only the first 80 characters are used. 

ERRORS : none . 


A - 73 



CPLTYP - Set Code for Plot Type 


LANGUAGE: FORTRAN 77 

PURPOSE: Set code for plot type. 

USE: CALL CPLTYP (IV) 

WHERE: IV - 

Code for plot type. 

Magnitude specifies the alternate points for symbol: 
Positive for line and symbol; 

Negative for symbol only. 

0 For line plot with the specified symbol at end; 

1 For symbol for each data point and line between; 
(default = 1 ) 

-2 For symbol for every other data point; 

-N For symbol for every other N'th data point. 

RANGE : Any INTEGER value. 

TYPE: INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI- 3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: none. 

NOTES: Attribute CLEAF determines which elements frlements will be 

selected, CPLTYP determines which selected elements will be 
represented by a symbol. 

ERRORS : 

CPLTYP: INVALID VALUE FOR IV. 

THE RANGE OF "NPLTYP" IS ANY INTEGER. 

ILLEGAL VALUE IS iv 

THE DEFAULT VALUE IS USED. 


2 

1 


0 

1 

2 


o o o 

□ □ o □ □ 


o 


A A A A- 

k k 


-A 


A - 74 



CPNTPT - Draw a NASA Symbol at the Specified Location 


LANGUAGE: FORTRAN 77 


PURPOSE: Draws a NASA point symbol at the specified location. 

The type and size of the symbol are specified by 
setting the associated attributes listed below. 


USE: CALL CPNTPT ( XO ,Y0) 

where: XO - Center of symbol X world coordinates, 
type : REAL 

YO - Center of symbol Y world coordinates, 
type: REAL 


ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: polygon attributes. 

2) CGL attributes: 

NSYMNO - The Type of symbol to be drawn: 


NSYMNO = 


0 

no symbol 



1 

circle 



2 

square (default) 


3 

diamond 



4 

triangle 



5 

right triangle 



6 

quadrant 



7 

dog house 



8 

fan 



9 

long diamond 



10 

house 



11 

circle 

with 

plus 

12 

square 

with 

plus 

13 

diamond 

with 

plus 

14 

triangle 

with 

plus 

15 

right triangle 

with 

plus 

16 

quadrant 

with 

plus 

17 

dog house 

with 

plus 

18 

fan 

wi th 

plus 

19 

lonq diamond 

with 

plus 

20 

house 

wi th 

plus 

21 

dot 



22 

plus sign 




If a flag is desired, add 100, 200,..., 900 
to NSYMNO, such that: 


1 

101 

- symbol 

- symbol 

+ 

upper 

right 

line 

201 

- symbol 

+ 

upper 

left 

line 

301 

- symbol 

+ 

lower 

left 

line 

401 

- symbol 

+ 

lower 

riqht 

line 

501 

- symbol 

4 * 

upper 

right 

flag 

601 

- symbol 

+ 

upper 

left 

flag 


A - 75 




701 - symbol + lower left flag 
801 - symbol + lower right flag 
901 - symbol is solid filled 
Range : 0 to 22,100 to 122,.. .,900 to 922. 

Type: INTEGER 

NSYMSZ - Size of symbol. 

Ranqe : REAL values greater than zero. 

Type : REAL 

RESTRICTIONS: 1) Segment must be open. 

2) CPNTPT will set the current position (CP) to XO,YO. 

ERRORS : none . 


NASA SYMBOLS 


ISYM = 


1 

o 

2 

□ 

3 

O 

4 

A 

5 

t\ 

6 

Qs 

7 

Q 

8 

O 

9 

0 

1 O 

A 

1 1 

© 

1 2 

0 

1 3 

b 

1 4 

A 

1 5 

Ik 

1 6 

a 

1 7 

0 

1 8 

<s> 

1 9 

$ 

20 

A 

21 

A FLAG IS 

22 + 
WANTED. 

ADD 

1 oo. 

200, 

.... 900 TO 

ISYM 

1 

O 

1 Ol 

0 

201 

b 

301 

P 

401 

P 

501 

Cf 

601 

b 

701 

b 

801 

P 

901 

• 


A - 76 



CREXP - Return the Integer Value between 1 [BSUP] * And ' [ESUP] ■ 


LANGUAGE: FORTRAN 77 

PURPOSE: To read a string "CEXP M and return an integer 

between " [ BSUP ] " and "[ESUP] M . 

USE: CALL CREXP (CEXP , IVAL ) 

where: CEXP - Character string to be scanned, 

type : CHARACTER ( * ) 

IVAL - Integer value returned, 
type: INTEGER 


ASSOCIATED ATTRIBUTES: 

1 ) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: The string CEXP must contain if [BSUP] IVAL [ ESUP] 

IVAL is limited to two digits. 

ERRORS : none . 


“IVAL 1 * 


A - 77 


CRLINT - Set Real to Integer Conversion Flag 


FORTRAN 77 

Set real to inteqer conversion flag for any numeric 
text to be displayed via the CGL. 

CALL CRLINT (LV) 

where: LV 

Real to integer conversion flag 

• TRUE. - Real is plotted as inteqer 

• FALSE. - Real is plotted as a real (default) 
The numeric value is not changed. Conversion 
is done to the character string containing 
the printed number. Hence, the number is not 
rounded. If rounding is preferred, it should 
be done by the user prior to calling the con- 
version routines, 
type: LOGICAL 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: none. 

ERRORS : none . 


LANGUAGE: 

PURPOSE: 

USE: 


A 


78 



CSCALE - 


To Determine publication Quality Axis Attributes 


FORTRAN 77 

Determine publication quality axis attributes. 

Specif ically, the data min and max are passed to 
this routine, which returns an adjusted minimum 
and maximum, the number of major and minor tick 
marks, and the appropriate number of decimal 
places to the left and right of the decimal point. 
These values will provide publication-quality 
labels when used on an axis. 

CALL CSCALE( DMIN, DMAX , AMIN , AMAX , N MAJOR , NMINOR , XINCR , 
NLEFT, NRIGHT) 

where: DMIN - Data minimum, (input) 

type : REAL 

DMAX - Data maximum. 

type -.REAL (input) 

AMIN - Adjusted data minimum. 

type : REAL ( returned ) 

AMAX - Adjusted data maximum, 
type : REAL ( returned ) 

N MAJOR - Number of major tick marks 
(including the endpoints), 
type: INTEGER (returned) 

NMINOR - Number of minor tick marks 
type: INTEGER (returned ) 

XINCR - The step value between min and max. 

XINCR set to ( AMAX- AMIN ) /NMAJOR- 1 . 
type : REAL ( returned ) 

NLEFT - Number of digits to the left 
of the decimal point. 

type: INTEGER (returned) 

NRIGHT - Number of digits to the right 
of the decimal point, 
type : INTEGER ( re turned ) 

ASSOCIATED ATTRIBUTES: 

1) DI- 3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: none. 

ERRORS : none . 


LANGUAGE: 

PURPOSE: 


USE: 


A - 79 


CSET - Set Common Graphics Library (CGL) Attributes 


LANGUAGE: FORTRAN 77 


PURPOSE: 


USE: 


This routine allows the user to set CGL attributes 
from a single routine* The use of a sinqle routine 
frees the user from finding and calling different 
routines, but at the expense of additional field 
length* If the user desires to call the specific 
routine, thus reducing the field length, then the 
routine is generally denoted as C#### for the 
attribute N####. 

Attribute Routine 

NHBTIC CHBTIC 

N. . . * • C 

NVMTIC CVMTIC 

CALL CSET (ATTRIBUTE, VALUE) 

where: ATTRIBUTE - option selection. 

type: character 
VALUE - option value. 

type: determined by option 


ASSOCIATED ATTRIBUTES: 

1) DI- 3000 attributes: none. 

2) CGL attributes: 

NHBTIC - Position of horizontal axis label in relation 
to horizontal tick marks. 

0 - labels centered at tick marks, (default) 

1 * labels centered between tick marks, 
type: INTEGER 

NHLABJ - Position of axis label in relation to 
horizontal axis, (above or below) 

0 - horizontal axis label is below axis . (default ) 

1 - horizontal axis label is above axis, 
type: INTEGER 

NHLOGF - Determine if horizontal axis will have 

major tick marks as 10 raised to a power. 

-1 - major tick mark labels decrease 

0 - no major tick mark labels (default) 

1 - major tick mark labels increase 
TYPE: INTEGER 

NHLOGS - The initial power for the horizontal log 

axis labels, (i.e., 10 raised to this power) 

(def ault=0) 

Range : any valid INTEGER. 

Type: INTEGER 


A - 80 


NHMTIC 


NHPREC 


NHTICJ 


NKLPLN 


NLABP 


NLEAF 


NLNPAT 


NMAGFL 


NPBCOL 


Number of minor tick marks between major tick 
marks for the horizontal axis. (default=0) 

Range : INTEGERS greater or equal to 0. 

TYPE: INTEGER 

Number of digits to the right of the decimal point 
in the tick mark labels of the horizontal axis. 

<0 - plot as an INTEGER (no decimal point) 

=0 - decimal point only 

>0 - plot as a REAL. Value represents the 

number of digits to the right of 
the decimal point 
Default: -1 

Type: INTEGER 

A value to indicate positioning of tick marks for 
horizontal axis. 

0 - tick marks are not positioned about the axis 

1 - tick marks positioned right of the axis. 

2 - tick marks positioned to the left of axis. 

3 - tick marks positioned on both sides of axis. 
Default: 1 

Type: INTEGER 

Key line pattern length (in inches). (Default=1.) 
Range : REAL values greater then 0. 

Type : REAL 

The size of the minor tick marks as a percentage 
of the size of the major tick marks. (Default=2/3 ) 
Range : REAL values greater than 0. 

Type : REAL 

Interleave factor for line plots (CLNPLT). 

1 values are stored sequentially (Default) 

2 values stored in every other location. 
Range : INTEGER values greater than 0. 

Type: INTEGER 

Line pattern for NASA standard line patterns. 

1 solid line (Default) 

2-8 NASA dashed patterns 
Range : INTEGER values between 1 and 8 (inclusive) 
Type: INTEGER 

Magnification factor of line pattern (CLNPLT) . 

Each element of the selected line pattern is 
multiplied by the value NMAGFL. (Default = 1.0) 
Range : REAL values greater then 0. 

Type: REAL 

Distance (in inches) between columns and between 
title and the identification column in the key. 
(Default*. 25) 


A - 81 


NPBLIN 


NPDKEY 


NPLTYP 


NRLINT 


NSYMSZ 


NTPREC 


NTCOL 


NVBTIC 


NVJUST 


Range : REAL values greater than 0. 

Type: REAL 

Distance between lines in the key (in inches)* 
(Default=*0B1 ) 

Range : REAL values greater than 0* 

Type: REAL 

Margins for the 4 sides of the key (in inches). 

(Def ault= .188) 

Range : REAL values greater than or equal to 0. 
Type: REAL 

Code for line plot type (CLNPLT) • 

Magnitude specifies the alternate points for symbol 
positive for line and symbol plot 
negative for symbol only 

0 for line plot with specified symbol at end 

1 for symbol for each data point and line between 
(default = 1 ) 

-2 for symbol for every other data point 
-n for symbol for every other n ' th data point 
Range : any INTEGER value. 

Type : INTEGER 

REAL to INTEGER conversion flag 
.TRUE. - REAL value is plotted as an INTEGER 
.FALSE. - REAL value is plotted as a REAL (default) 
Type : logical 

Size of symbol. 

Range : REAL values greater than zero. 

Type: REAL 

Text precision. 

Range : 1 - string precision text. 

2 - character precision text. 

3 - stroke precision text. 

4 - graphics art precision text. 

5 - DI-TEXTPRO precision text. 

Type: INTEGER 

Text color. 

Range : 0 or greater (see underlying package). 

Type: INTEGER 

Position of vertical axis label in relation to 
to vertical tick marks. 

0 - labels centered at tick marks, (default) 

1 - labels centered between tick marks. 

Type: INTEGER 

Determines if vertical axis label is written 
horizontally or vertically. 


A - 82 



0 - vertical (default). 

1 - horizontal* 

Type: INTEGER 

NVLABJ - Position of axis label in relation to 
vertical axis* (left or riqht) 

0 - vertical axis label is left of axis • (default ) 

1 - vertical txis label is riqht of axis, 
type: INTEGER 

NVLOGF - Determine if vertical log axis will have 
major marks as 10 raised to a power. 

-1 - no major tick mark labels 

0 - major tick mark labels (default) 

1 - major tick mark labels increase 
Type: INTEGER 

NVLOGS - The initial power for the vertical log 
axis labels • 

Range: any valid INTEGERt 1 0 raised to this power), 
(default 0) 

Type: INTEGER 

NVMTIC - Number of minor tick marks between major tick 
marks for the vertical axis. (default=0) 

Range : INTEGER values greater than or equal to 0 
Type: INTEGER 

NVPREC - Number of digits to the right of the decimal point 
in the tick mark labels of the vertical axis* 

< 0 display as a REAL. value represents the 

number of digits to the right of the 
decimal point. 

=0 - decimal point only 

>0 - display as INTEGER (no decimal point) 

default: -1 

Type: INTEGER 

NVTICJ - A value to indicate positioning of tick marks for 
vertical axis* 

0 - tick marks are not positioned about the axis. 

1 - tick marks positioned right of the axis. 

2 - tick marks positioned to the left of axis. 

3 - tick marks positioned on both sides of axis, 
default: 1 

Type: INTEGER 

RESTRICTIONS: 1) Segment must be open. 

ERRORS: Errors from the routines which set the attributes. 

EXAMPLE: 

CALL CSET( * NLEAF* , nleaf_val) or CALL CLEAF ( n leaf -real ) 
CALL CSET( 'NLNPAT' ,nlnpat_val) or CALL CLNPAT ( nlnpat-va 1 ) 


A - 83 



CALL CS ET( 1 NSYMSZ 1 ,nsymsz_val) 
CALL CSET( 'NPLTYP 1 ,npltyp val) 


or CALL CSYMSZ(nysmsz-val) 
or CALL CPLTYP(npltyp-val) 


A - 84 



CSETBP - Set the Base/Plane Vectors for an Angle of Rotation 


LANGUAGE: FORTRAN 77 

PURPOSE: Set the base/plane vectors for an angle of rotation, 

USE: CALL CSETBP (ANGLE) 

where 

ANGLE - Angle of rotation (degrees), 
type: REAL 

NOTE: This routine will set JBASE and JPLANE, and 

not restore these values. 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: Segment must be open. 

ERRORS : none . 


A - 85 




CSTRG - Output Graphics Text 


LANGUAGE: FORTRAN 77 

PURPOSE: Output graphics text* 

USE: CALL CSTRG (STR) 

where: STR - 

Graphics text string to be displayed. 
Type: CHARACTER 

ASSOCIATED ATTRIBUTES: 

1) DI- 3000 attributes: text attributes. 

2) CGL attributes: 

NTCOL - Text color. 

Range : 0 or greater (see underlying package). 
Type: INTEGER 

NTPREC - Text precision. 

Range : 1 - string precision text. 

2 - character precision text. 

3 - stroke precision text. 

4 - graphics art precision text. 

5 - DI-TEXTPRO precision text. 

Type: INTEGER 

RESTRICTIONS: Segment must be open. 

DI-TEXTPRO must be part of the load process if 
NTPREC equals 5. 

ERRORS : none . 


A - 86 



CSTRIP - Find indices for first and last non-blank character 


FORTRAN 77 

Find indices for the first and last non-blank 
character (i*e., IBEG and I END respectively). 

CALL CSTRIP( STRING, IBEG, IEND) 

STRING - Character string. 

Type: CHARACTER 

IBEG - First non-blank character position, 

(returned ) 

Type : CHARACTER 

IEND - Last non-blank character position, 

(returned ) 

Type: CHARACTER 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 


RESTRICTIONS : A 

blank character string will 

result in 



IBEG and IEND set to one. 



ERRORS : 

none. 




EXAMPLE: 

given 

CHARACTER* 5 C1,C2,C3 
DATA C1/’1 3 5 1 / , 0 . 2 /' 234 

* / r C3/ * 

•/ 


then 

CALL CSTRIP(C1 , IBEG, IEND) 

==> IBEG=1 , 

IEND=5 



CALL CSTRIP(C2, IBEG, IEND) 

==> IBEG=2 , 

IEND=4 



CALL CSTRIP(C3, IBEG, IEND) 

==> IBEG=1 , 

IEND=1 


LANGUAGE: 

PURPOSE: 

USE: 


A - 87 



CSYMNO - Set the Type of Symbol 


LANGUAGE: FORTRAN 77 

PURPOSE: Set the type of symbol 

USE: CALL CSYMNO( NSYMNO) 

where: NSYMNO - 


0 

no symbol 



1 

circle 



2 

square (default) 


3 

diamond 



4 

triangle 



5 

right triangle 



6 

quadrant 



7 

dog house 



8 

fan 



9 

long diamond 



10 

house 



1 1 

circle 

with 

plus 

12 

square 

with 

plus 

13 

diamond 

with 

plus 

14 

trianqle 

with 

plus 

15 

right triangle 

with 

plus 

16 

quadrant 

with 

plus 

17 

dog house 

with 

plus 

18 

fan 

with 

plus 

19 

long diamond 

with 

plus 

20 

house 

with 

plus 

21 

dot 



22 

plus sign 




If a flag is desired, add 100, 200,..., 900 to 
NSYMNO, such that: 

1 - Symbol 

101 - Symbol + upper riqht line 

201 - Symbol + upper left line 

301 - Symbol + lower left line 

401 - Symbol + lower riqht line 

501 - Symbol + upper riqht flag 

601 - Symbol + upper left flag 

701 - Symbol + lower left flag 

801 - Symbol + lower right flag 

901 - Symbol is solid filled 
range : 0 to 22,100 to 122, ...,900 to 922. 
type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI- 3000 attributes: none. 

2) CGL attributes: none. 


A - 88 


RESTRICTIONS : none 


ERRORS : 

CSYMNO: IV MUST BE AN INTEGER .GE.O. 

ATTEMPTED TO PASS IV= iv 
THE DEFAULT VALUE IS USED. 


NASA SYMBOLS 


ISYM — 


1 

o 

2 

□ 

3 

O 

A 

A 

5 

Cl 

6 

CL 

7 

Q 

8 

o 

9 

0 

1 O 

A 

1 1 

0 

1 2 

El 

1 3 

❖ 

1 A 

A 

1 5 

Ik 

1 6 

a 

1 7 

Q 

1 8 

<5> 

1 9 

$ 

20 

(h 

21 


22 

+ 







^ FLAG IS 

WANTED. 

ADD 

1 oo. 

200, 

.... 900 TO 

ISYM 

1 

o 

101 

b 

201 

b 

301 

P 

401 

Q 

501 

cf 

601 

b 

701 

b 

801 

P 

901 

• 


A - 89 



CSYMSZ - Set Size of Symbol 


LANGUAGE: FORTRAN 77 

PURPOSE: Set size of symbol 

USE: CALL CSYMSZ(NSYMSZ) 

where: NSYMSZ - Size of symbol 

To set the symbol size in terms of current 
page coordinates. 

range: Real values greater than zero 
type: REAL 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 


RESTRICTION: Segment must be open. 

ERRORS : 

CSYMSZ : INVALID VALUE FOR RV. 

THE RANGE OF "NSYMSZ" IS .GT. ZERO (REAL). 

ILLEGAL VALUE IS rv 

THE DEFAULT VALUE IS USED. 


A - 90 



CTCOL - Set Text Color for CGL Graphics Text 


LANGUAGE: FORTRAN 77 

PURPOSE: Set text color for all subsequent CGL graphical text, 

USE: CALL CTCOL (IV) 

WHERE: IV - 

Text color (for all subsequent text), 
range : 0 or greater (see underlying graphics 
package ) . 
type : INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: none. 

ERRORS : 

CTCOL: INVALID VALUE FOR IV. 

THE RANGE OF "NTCOL” IS ANY INTEGER • 

ILLEGAL VALUE IS iv 

THE DEFAULT VALUE IS USED. 


A - 91 




CTODX - Convert Degrees to a Vector Related Value 


LANGUAGE: 

PURPOSE: 


USE: 


NOTE: 


FORTRAN 77 

To convert deqrees to a vector related value. 
Conversion formula: value = TAN(XDEG in radians) 

Example: JBASE(DX , 1 . , 0 . ) , where DX=CTODX( XDEG) • 

VALUE=CTODX ( XDEG ) 

where : 

XDEG - Anqle(in degrees) to be converted, 
type: REAL 

The sign of the resultant value of CTODX is the 
same as the siqn of XDEG. 

If the TAN result is 0, then CTODX is 0. 


ASSOCIATED ATTRIBUTES: 

1 ) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS : none . 


ERRORS : 


none. 


CTPREC - Set Text Precision for CGL Graphical Text 


LANGUAGE: FORTRAN 77 

PURPOSE: Set text precision for all subsequent CGL graphical 

text. 

USE: CALL CTPREC (IV) 

WHERE: IV - 

Text precision. 

range : 1 - String precision text. 

2 - Character precision text. 

3 - Stroke precision text. 

4 - Graphics art precision text. 

5 - DI-TEXTPRO precision text, 
type: INTEGER 


ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 


RESTRICTIONS: 1) DI-TEXTPRO must be loaded prior to execution if 
type 5 is (to be) selected. 

NOTES: Call CSETBP ( ANGLE) for text to be written at an angle of 
rotation (see CSETBP description). 


ERRORS : 

CTPREC: INVALID VALUE FOR IV. 

THE RANGE OF ,, NTPREC ,, IS ANY INTEGER. 

ILLEGAL VALUE IS iv 

THE DEFAULT VALUE IS USED. 


A - 93 



CVAXIC - Draw a Vertical Axis with Character Labels 


LANGUAGE: FORTRAN 77 

PURPOSE: To draw a vertical axis with character labels. 

This routine retrieves attributes (DI-3000 and CGL) 
when the subroutine is invoked. These axis 
characteristics remain in force until SUBROUTINE 
CVAXIC is reinvoked. 

If a vertical axis label is desired, SUBROUTINE CVLAB 
must be invoked prior to this routine. 


USE : CALL CVAXIC ( XLEN, NTIC , CHARA , NLINES , NLABS ) 

XLEN - Length of axis (in world coordinates), 
range: greater than 0. 
type: REAL 

NTIC - Number of tick marks (end tick marks 
inclusive) . 

If NTIC is negative, the major and minor 
tick marks will be suppressed, but the 
tick mark labels will be retained, 
range: IABS(NTIC) must be greater than 1. 
type: INTEGER 

CHARA - Tick mark labels, dimensioned 
CHARA (NLINES, NLABS) . 
type: CHARACTER 

NLINES - Number of lines in the tick mark labels. 

Range: must be greater than or equal to 0. 
type: INTEGER 

NLABS - Number of labels for the tick marks. 

Range: must be greater than or equal to 0. 
type : INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: line attributes, text attributes. 

2) CGL attributes: 

NVBTIC - Position of vertical axis label in relation to 
to vertical tick marks. 

0 - labels centered at tick marks, (default) 

1 - labels centered between tick marks. 

Type: INTEGER 

NVJUST - Determines if vertical axis label is written 
horizontally or vertically. 

0 - vertical (default) . 

1 - horizontal. 

Type: INTEGER 

NVLABJ - Position of axis label in relation to 
vertical axis, (left or right) 


A - 94 


VERTICAL AXIS LABEL 


0 - vertical axis label is left of axis . (default) 

1 - vertical axis label is right of axis. 

Type: INTEGER 

NVMTIC - Number of minor tick marks between major tick 
marks for the vertical axis. (default=0) 

Range : INTEGER values greater than or equal to 0 
Type: INTEGER 

NVTICJ - A value to indicate positioning of tick marks for 
vertical axis. 

0 - tick marks are not positioned about the axis. 

1 - tick marks positioned right of the axis. 

2 - tick marks positioned to the left of axis. 

3 - tick marks positioned on both sides of axis, 
default: 1 

Type: INTEGER 

NVTROT - Angle of rotation for vertical axis tick 
mark labels. 

Type: INTEGER 

RESTRICTIONS: 1) XLEN must be positive. 

2) An absolute minimum of two major tick marks. 

3) Segment must be open. 

ERRORS : 

CVAXIC : NTIC MUST BE AN INTEGER .GT. 1. 

ATTEMPTED TO PASS NTIC= ntic 
THIS ROUTINE IS NOT EXECUTED. 

CVAXIC: NLINES MUST BE AN INTEGER .GE.O. 

ATTEMPTED TO PASS NLINES= nlines 
THIS ROUTINE IS NOT EXECUTED. 

CVAXIC: NLABS MUST BE AN INTEGER .GE. 0 

ATTEMPTED TO PASS NLABS= nlabs 
THIS ROUTINE IS NOT EXECUTED. 

CVAXIC: INVALID VALUE FOR XLEN. 

THE RANGE OF ,, XLEN M IS .GT. ZERO. 

THE ROUTINE IS NOT EXECUTED. 

CVAXIC: TICK MARK ROTATION (NVTROT) ONLY APPLY TO 

ONE TICK MARK LINE (NLINES). 

NO ROTATION PERFORMED. 



A - 95 


CVAXIS - Draw a Vertical Axis with Numeric Labels 


LANGUAGE: FORTRAN 77 


PURPOSE: 


USE: 


This routine plots a vertical axis. The 
numeric values are calculated, converted to labels,, 
then CVAXIC routine is called to do the actual 
plotting. The attributes for CVAXIC are the same and 
actually do not affect this routine, but will affect 
the actual plot. 

CALL CVAXIS ( VTMIN , VTMAX , TINCR , VLONG ) 


where: VTMIN - 

VTMAX - 
TINCR - 
VLONG - 


Minimum value used for tick marks 


(Type: REAL) 

Maximum value used for tick marks 
(Type: REAL) 

Increment value of tick marks 


(Type: REAL) 

Lenqth of axis in current world 

coordinates 

(Type: REAL) 


ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: line attributes, text attributes. 

2) CGL attributes: 

NVBTIC - Position of vertical axis label in relation to 
to vertical tick marks. 

0 - labels centered at tick marks, (default) 

1 - labels centered between tick marks. 

Type: INTEGER 

NVJUST - Determines if vertical axis label is written 
horizontally or vertically. 

0 - vertical (default) . 

1 - horizontal. 

Type: INTEGER 

NVLABJ - Position of axis label in relation to 
vertical axis, (left or riqht) 

0 - vertical axis label is left of axis . (default) 

1 - vertical axis label is riqht of axis. 

Type: INTEGER 

NVMTIC - Number of minor tick marks between major tick 
marks for the vertical axis. (default=0) 

Ranqe : INTEGER values qreater than or equal to 0 
Type: INTEGER 

NVPREC - Number of diqits to the right of the decimal point 
in the tick mark labels of the vertical axis. 

<0 - display as a REAL, value represents the 


A - 96 


number of digits to the right of the 
decimal point. 

=0 - decimal point only 

>0 - display as INTEGER (no decimal point) 

default: -1 

Type: INTEGER 

NVTICJ - A value to indicate positioning of tick marks for 
vertical axis. 

0 - tick marks are not positioned about the axis* 

1 - tick marks positioned right of the axis# 

2 - tick marks positioned to the left of axis. 

3 - tick marks positioned on both sides of axis* 

default: 1 

Type: INTEGER 

NVTROT - Angle of rotation for vertical axis tick 
mark labels. 

Type: INTEGER 

RESTRICTIONS: 1) Tick mark labels always occur at the major tick 
marks (regardless of attribute settings). 

2) If VTMIN is greater than VTMAX, then TINCR must be 
negative. VTMIN and VTMAX cannot be equal. 

3) Segment must be open. 


ERRORS : none • 

NOTES: If VTMIN is greater than VTMAX, then axis labels will 
be output in decreasing order. 


X 

3 

9 

C 

5 


.010 
.000 
.008 
.007 

.008 h 

.005 
.004 
.005 
.002 
.001 I— 

0 L 



Wtng Length 


A Title 


A - 97 


CVBTIC - Set Position of Vertical Axis Label Tick Marks 


FORTRAN 77 

Set position of vertical axis label tick marks. 

CALL CVBTIC(IV) 

WHERE: IV - 

Position of vertical axis label in relation to 
vertical tick marks. 

0 - Labels centered at tick marks, (default) 

1 - Labels centered between tick marks, 
type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS : none . 

ERRORS : 

CVBTIC: INVALID VALUE FOR IV. 

THE RANGE OF "NVBTIC" IS 0,1 (INTEGER). 

ILLEGAL VALUE IS iv 

THE DEFAULT VALUE IS USED. 


LANGUAGE: 

PURPOSE: 

USE: 



ABC 


A 


CALL CVBT»C{0) 


CAUL CVBTJC(t) 


CVJUST - Set Position of Vertical Axis Label (Horizontal/Vertical) 


LANGUAGE: FORTRAN 77 

PURPOSE: Set position of vertical axis label 

(horizontal/ vertical) 

USE: CALL CVJUST(IV) 

where: IV - 

Determines if vertical axis label is written 
horizontally or vertically, 

0 - vertical (default) 

1 - horizontal* 
type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI- 3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS : none . 

ERRORS : 

CVJUST: INVALID VALUE FOR IV. 

THE RANGE OF "NVJUST" IS 0,1 (INTEGER). 

ILLEGAL VALUE IS iv 

THE DEFAULT VALUE IS USED. 



A - 99 



CVLAB - Describe the Text and Attributes of Vertical Axis Label 


FORTRAN 77 

To describe the text and associated attributes 
of the vertical axis label. 

This routine retrieves attributes (DI-3000 and CGL) 

when the subroutine is invoked. These label 
characteristics remain in force until SUBROUTINE 
CVAXIC is reinvoked. 

CALL CVLAB ( CHARA , NLINE ) 

CHARA(NLINE) - Array of characters for axis, 
type: CHARACTER 

NLINE - Number of lines in label, 

type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: line attributes, text attributes. 

2) CGL attributes: 

NVJUST - Determines if vertical axis label is written 
horizontally or vertically. 

0 - vertical (default). 

1 - horizontal. 

Type: INTEGER 

RESTRICTIONS : 

1) Maximum number of lines per axis label is limited to 5. 

2) The number of characters per line is limited to 256. 

3) All lines in axis label are single spaced. 

4) Segment must be open. 

ERRORS : 

CVLAB: NLINE MUST BE AN INTEGER .GE. 0. 

ATTEMPTED TO PASS NLINE= nline 
THIS ROUTINE IS NOT EXECUTED. 

Note: If NLINE is less than or equal to 0, then all vertical axis 
label attributes are reinitialized. 


LANGUAGE: 

PURPOSE: 


USE: 


A - 100 


CVLABJ - Set Position of Axis Label Relative to Vertical Axis 


LANGUAGE: FORTRAN 77 

PURPOSE: Set position of axis label relative to vertical axis. 

USE: CALL CVLABJ(IV) 

where: IV - 

Position of axis label in relation to vertical 
axis, (left or right) 

0 - Vertical axis label is left of axis. 

(default) 

1 - Vertical axis label is right of axis, 
type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 


RESTRICTIONS : none . 

NOTES: Attribute CVTICJ controls the vertical axis tick mark 
positioning (i.e., above, below,etc.). The attribute 
CVLABJ controls the positioning of the tick mark labels. 


ERRORS : 


CVLABJ: INVALID VALUE FOR IV. 

THE RANGE OF "NVLABJ" IS 0,1 (INTEGER). 

ILLEGAL VALUE IS iv 

THE DEFAULT VALUE IS USED. 



.010 

.000 


.006 


.007 


.006 


.005 


.004 


.003 


.002 

.001 

0 


9 

C 


Horizontal Axla 

CALL CVLABJ(O) CALL CVLABJ(I) 


A - 101 



CVLOG - Draw a Vertical Log Axis 


LANGUAGE: FORTRAN 77 

PURPOSE: To draw a vertical log axis. 

This routine retrieves attributes (DI-3000 and CGL) 
when the subroutine is invoked. These 
characteristics remain in force until subroutine 
CVLOG is reinvoked. 

If a vertical axis label is desired, subroutine CVLAB 
must be invoked prior to this routine. 

USE: CALL CVLOG(XLEN , NTIC , NVLOGI ) 

XLEN - Length of axis (in world coordinates), 
range: greater than 0. 
type: REAL 

NTIC - Number of tick marks (end tick marks 

inclusive; i.e., number of cycles-1 on XLEN). 
If NTIC is negative, the major 
tick marks will be suppressed, but the 
numeric tick mark labels will be retained, 
range: IABS(NTIC) must be greater than 1. 
type: INTEGER 

NVLOGI - Tick mark label type. 

The following are the various types : 

0 - No small tick marks. 

1 - 1 ,2, 3, 4, 5, 6, 7, 8, 9,1 

2 - 1 , 2 , 4 , 6 , 8,1 

3 - 1,3, 5, 7, 9,1 

4 - 1 ,5,1 
5-1,1 

6 - 2 , 3 , 4 , 5 , 6 , 7 , 8, 9 

7 - 2, 4, 6, 8 

8 - 3, 5 , 7, 9 
9-5 

If NVLOGI is positive then labels and 
small log tick marks are drawn, 
if NVLOGI is negative then only small log 
tick marks are drawn, 
type: INTEGER 


ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: line attributes, text attributes. 

2) CGL attributes: 

NLABP - The size of the minor tick marks as a percentage 

of the size of the major tick marks. (Def ault=2/3 ) 
Range : REAL values greater than 0. 

Type : REAL 

NVLABJ - Position of axis label in relation to 
vertical axis, (left or right) 


A - 102 


0 - vertical axis label is left of axis. (default) 

1 - vertical axis label is riqht of axis. 

Type : INTEGER 

NVLOGF - Determine if vertical log axis will have 
major marks as 10 raised to a power. 

-1 - no major tick mark labels 

0 - major tick mark labels (default) 

1 - major tick mark labels increase 
Type: INTEGER 

NVLOGS - The initial power for the vertical log 
axis labels . 

Range: any valid INTEGEROO raised to this power), 
(default 0) 

Type : INTEGER 

RESTRICTIONS: 1) XLEN must be positive. 

2) An absolute minimum of two major tick marks. 

3) Segment must be open. 


ERRORS : 

CVLOG: XLEN MUST BE .GT. 0. 

ATTEMPTED TO PASS XLEN* xlen. 

THIS ROUTINE IS NOT EXECUTED. 

CVLOG: NTIC MUST BE AN INTEGER .GT. 1 . 

ATTEMPTED TO PASS NTIC* ntic. 

THIS ROUTINE IS NOT EXECUTED. 

CVLOG: INVALID VALUE FOR XLEN. 

THE RANGE OF "XLEN" IS .GT. ZERO. 
THE ROUTINE IS NOT EXECUTED. 

CVLOG: INVALID VALUE FOR NVLOGI . 

THE RANGE OF "NVLOGI" IS -9 TO 9. 
THE ROUTINE IS NOT EXECUTED. 


A - 103 



VERTICAL LOG AXIS LABEL 


9 — 
8 — 


VERTICAL LOG AXIS 


1) TO SET AXIS LABEL 

CALL CVLABS(CHARA, NLINE) 

CHARA ARRAY OF CHARACTERS FOR THE AXIS 
NLINE NUMBER OF LINES IN THE AXIS LABEL 


2) TO DRAW AXIS AND LABEL 

CALL CVLOG(XLEN, NTIC, NLOGI) 

XLEN LENGTH OF THE AXIS 

NTIC NUMBER OF MAJOR TIC MARKS 

NLOGI TIC MARK LABEL TYPE 

0 - NO MINOR TIC MARKS 

1 - 1,2, 3, 4, 5. 6, 7, 8, 9,1 

2 - 1,2, 4, 6, 8,1 

3 - 1,3, 5,7,9, 1 

4 - 1,5,1 

5 - 1,1 

6 - 2, 3, 4, 5, 6, 7, 8, 9 

7 - 2, 4, 6, 8 

8 - 3, 5, 7, 9 

9 - 5 




A 


104 


CVLOGF - Set Vertical Log Axis Raised to a Power of 10 


LANGUAGE: FORTRAN 77 

PURPOSE: Set vertical log axis raised to a power of 10 

USE: CALL CVLOGF (IV) 

where: IV - 

Determine if vertical log axis will have 
# major marks as 1 0 raised to a power, 

1 - Major tick mark labels decrease 

0 - No major tick mark labels (default) 

1 - Major tick mark labels increase 
type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1 ) DI-3000 attributes: none, 

2) CGL attributes: none, 

RESTRICTIONS : none . 

ERRORS : 

CVLOGF: INVALID VALUE FOR IV. 

THE RANGE OF "NVLOGF 11 IS -1,0,1 (INTEGER). 

ILLEGAL VALUE IS iv. 

THE DEFAULT VALUE IS USED. 


CVLOGS - Set the Initial Power of the Vertical Log Axis Label 


LANGUAGE: FORTRAN 77 

PURPOSE: Set the initial power of the vertical LOG axis label 

USE: CALL CVLOGS (IV) 

where: IV - 

The initial power for the vertical log axis 
labels (i.e., 10 raised to this power), 
range: Any valid integer 

(default 0) 
type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS : none . 

ERRORS : 

CVLOGS: INVALID VALUE FOR IV. 

THE RANGE OF "NVLOGS' 1 IS ANY INTEGER. 

ILLEGAL VALUE IS iv. 

THE DEFAULT VALUE IS USED. 


A - 106 



CVMTIC - Set the Number of Vertical Minor Tick Marks between Major 


FORTRAN 77 

Set the number of vertical minor tick marks between 
major tick marks. 

CALL CVMTIC (IV) 

where: IV - 

Number of minor tick marks between major tick 
marks for the vertical axis. (default = 0) 
range: Integer values greater or equal to 0. 

type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS : none . 

ERRORS : 

CVMTIC: INVALID VALUE FOR IV. 

THE RANGE OF "NVMTIC" IS .GE. ZERO (INTEGER). 

ILLEGAL VALUE IS iv. 

THE DEFAULT VALUE IS USED. 


LANGUAGE: 

PURPOSE: 

USE: 


A - 107 




CVPORT - Define a Viewport into the Virtual Coordinates by DI-3000 


LANGUAGE: FORTRAN 77 

PURPOSE: This subroutine uses "relative" inches to define 

virtual coordinates used by DI-3000 based upon the 
values contained in the COMMON BLOCK CFRSIZ. Routine 
CVSPAC defines the maximum relative inches (minimum 
is always zero). This is used to map the virtual 
coordinates to device coordinates. 

USE : CALL CVPORT ( XLCOR , YLCOR , XUCOR , YUCOR ) 

XLCOR - X value of the lower boundary of the 

viewport (inches). (default = 0 inches) 
range: 0 or greater, 
type : REAL 

XUCOR - X value of the right boundary of the 

viewport (inches). (default = height) 
range: cannot exceed width in CVSPAC. 
type : REAL 

YLCOR - Y value of the left boundary of the 

viewport (inches). (default = 0 inches) 
range: 0 or greater, 
type : REAL 

YUCOR - Y value of the upper boundary of the 
viewport (inches). (default = width) 
range: cannot exceed height in CVSPAC. 
type : REAL 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: 1) Subroutine CVSPAC must be called prior to CVPORT. 

2) Segment must NOT be open. 

ERRORS : 

CVPORT: XLCOR MUST BE .GE. 0. 

ATTEMPTED TO PASS XLCOR= xlcor. 

THIS ROUTINE IS NOT EXECUTED. 

CVPORT: YLCOR MUST BE .GE. 0. 

ATTEMPTED TO PASS YLCOR= ylcor. 

THIS ROUTINE IS NOT EXECUTED. 


A - 108 



CVPREC - Set Vertical Numeric Axis Tick Mark Label Precision 


LANGUAGE: 


FORTRAN 77 


PURPOSE: 


Set vertical numeric axis tick mark label precision. 


USE: 


CALL CVPREC(IV) 


Where: IV - 


Number of digits to the right of the 
decimal point in the tick mark labels 
of the vertical axis* 


0 

0 

0 


default 


Plot as an integer 

Decimal point only 

Plot as a real. IV represents 

the number of digits to the 

right of the decimal point* 

: -1 


type: INTEGER 


ASSOCIATED ATTRIBUTES: 

1) DI- 3000 attributes: none. 

2) CGL attributes: none. 


RESTRICTIONS : none . 

ERRORS : 

CVPREC: INVALID VALUE FOR IV. 

ATTEMPTED TO PASS IV= iv. 
THE DEFAULT VALUE IS USED. 


A - 109 



CVSPAC - Establish DI-3000 Boundaries for an Entire Frame 


LANGUAGE: FORTRAN 77 

PURPOSE: Establishes DI-3000 boundaries for an entire 

frame which correspond to the values used on 
the plot card. This routine should be called for 
plotting regions that are rectangular rather 
than square. If this routine is not invoiced 
then the default frame will be an 11“ by 11“ 
square. This routine can only be called once, and 
must be called prior to opening the first segment. 

This routine will establish a coordinate system 
based on the values in the X-direction of 0 to 
width, and values in the Y-direction of 0 to 
height. These coordinates are referred to as 
“inches" or “relative inches". 

USE: CALL CVSPAC (WIDTH , HEIGHT ) 

WIDTH - Width of the frame. Should be same as 

or proportional to the value used on the 
plot card used to call the device driver 
for the static plotters, (default =11.) 
range: greater than 0. 
type : REAL 

HEIGHT - Height of the frame. Should be same as 

or proportional to the value used on the 
plot card used to call the device driver 
for the static plotters . (default =11.) 
range: greater than 0. 
type : REAL 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: 1) WIDTH and HEIGHT must be greater than 0. 

2) Must be called prior to opening the first segment. 

ERRORS : 

CVSPAC: HEIGHT MUST BE .GE. 0. 

ATTEMPTED TO PASS HEIGHT= height. 

THIS ROUTINE IS NOT EXECUTED. 

CVSPAC: WIDTH MUST BE .GE. 0. 

ATTEMPTED TO PASS WIDTH= width. 

THIS ROUTINE IS NOT EXECUTED. 

I 

i 


A 


110 



CVTICJ - Set the Tick Mark Position Relative to the Vertical Axis 


I 

LANGUAGE: FORTRAN 77 


PURPOSE: Set the tick mark position relative to the 

vertical axis. 

USE: CALL CVTICJ (IV) 

WHERE: IV - 

is a value to indicate positioning of tick marks. 

0 — No tick marks on the axis. 

1 - Tick marks positioned right of the axis. 

(default) 

2 - Tick marks positioned to the left of axis. 

3 - Tick marks positioned on both sides of axis. 
Type : INTEGER 


ASSOCIATED ATTRIBUTES: 

1) DI- 3000 attributes: none. 

2) CGL attributes: none. 


RESTRICTIONS : none . 


NOTES: Attribute CVTICJ controls the vertical axis tick mark 
positioning (i.e., above, below,etc.). The attribute 
CVLABJ controls the positioning of the tick mark labels. 

ERRORS : 

CVTICJ: IV MUST BE A 0, 1, 2 , 3. 

ATTEMPTED TO PASS IV= iv. 

THE DEFAULT VALUE IS USED. 



i 


no tick marks Tick marks on t>c 
CALL CVTCJ<C) moktofmub 

CALL CVTCJO) 


1 


TICK MAAKS ON T>C 
LEFT OF TV* AXIS 
CAU CVTICJ^) 


TICK marks on •oth 
■CCS OF TIC AXIS 
CALL CVTCJ0) 


-111 


A 


VERTICAL LINE 1 


CVTROT - Set Angle of Rotation for Vertical Axis Tick Mark Labels 


LANGUAGE: FORTRAN 77 

PURPOSE: Set angle of rotation for vertical axis tick mark 

labels . 

USE: CALL CVTROT (IV) 

WHERE: IV - Rotation angle. 

type: INTEGER. 

ASSOCIATED ATTRIBUTES: 

1 ) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS: 1) Angles are entered in as integer values. 
ERRORS : 

CVTROT: INVALID VALUE FOR IV. 

ATTEMPTED TO PASS IV= iv. 

THE DEFAULT VALUE IS USED. 



CALL CVTROT (0) CALL CVTROT(45) 


A 


1 1 2 



CXCAXiC - Return Equivalent Delta X Value for a Given Delta Y 


LANGUAGE: FORTRAN 77 

PURPOSE: Return the equivalent delta X value for a given 

delta Y (in world coordinates), 

USE: x_va lue = CXCALC(YVAL) 

where : YVAL - Y distance in world coordinates, 

type : REAL 


ASSOCIATED ATTRIBUTES: 

1) DI- 3000 attributes: none, 

2) CGL attributes: none, 

RESTRICTIONS : none , 

ERRORS : none , 


A - 113 


CYCALC - Return Equivalent Delta Y Value for a Given Delta X 


LANGUAGE: FORTRAN 77 

PURPOSE: Return the equivalent delta Y value for a given 

delta X (in world coordinates). 

USE: y__va lue = CYCALC (XVAL) 

where : XVAL - X distance in world coordinates 
type : REAL 


ASSOCIATED ATTRIBUTES: 

1 ) DI- 3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS : none . 

ERRORS : none . 


A - 1 14 


Cl NMBR - Draw a Numeric Value Using Text Precision 


FORTRAN 77 

This routine draws a numeric value using current 
text attributes • Low quality text precision is used. 

CALL Cl NMBR ( VALUE , NDEC ) 

where: VALUE - Value to be plotted real or integer, 
type : REAL 

NDEC - Integer specifying number of digits 
to the right of the decimal point. 

NDEC » 0 - Decimal point, number digits 
to the right. 

NDEC < 0 - No decimal point, min number 
of digits in integer value, 
type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS : 

1) The number is restricted to a maximum of 12 significant digits. 

2) Segment must be open. 

ERRORS : 

Cl NMBR: NDEC MUST BE AN INTEGER. 

ATTEMPTED TO PASS NDEC= ndec 
THIS ROUTINE IS NOT EXECUTED. 


LANGUAGE: 

PURPOSE: 

USE: 


A 


115 


C2NMBR - Draw a Numeric Value Using Character Precision 


FORTRAN 77 

This routine draws a numeric value using current 
text attributes. Character precision is used. 

CALL C2NMBR( VALUE, NDEC) 

where: VALUE - Value to be plotted real or integer, 
type : REAL 

NDEC - Integer specifying number of digits 
to the right of the decimal point. 

NDEC * 0 - Decimal point, number digits 
to the right. 

NDEC < 0 - No decimal point, min number 
of digits in integer value, 
type: INTEGER 

ASSOCIATED ATTRIBUTES: 

1 ) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS : 

1) The number is restricted to a maximum of 12 significant digits. 

2) Segment must be open. 

ERRORS : 

C2NMBR: NDEC MUST BE AN INTEGER. 

ATTEMPTED TO PASS NDEC* ndec 
THIS ROUTINE IS NOT EXECUTED. 


LANGUAGE: 

PURPOSE: 

USE: 


A - 116 


C3NMBR - Draw a Numeric Value Using Stroke Precision 


FORTRAN 77 

This routine draws a numeric value using current 
text attributes. Stroke precision is used. 

CALL C3NMBR( VALUE, NDEC ) 

where: VALUE - Value to be plotted real or integer, 
type: REAL 

NDEC - Integer specifying number of digits 
to the right of the decimal point. 

NDEC = 0 - Decimal point, number digits 
to the right. 

NDEC < 0 - No decimal point, min number 
of digits in integer value, 
type : INTEGER 

ASSOCIATED ATTRIBUTES: 

1) DI-3000 attributes: none. 

2) CGL attributes: none. 

RESTRICTIONS : 

1) The number is restricted to a maximum of 12 significant digits. 

2) Segment must be open. 

ERRORS : 

C3NMBR: NDEC MUST BE AN INTEGER. 

ATTEMPTED TO PASS NDEC= NDEC. 

THIS ROUTINE IS NOT EXECUTED. 


LANGUAGE: 

PURPOSE: 

USE: 


A - 117 


APPENDIX B 


CHARTS AND TEST CASES OF THE LOW-LEVEL ROUTINES 

In this appendix, the output generated by the sample programs will appear before 
the programs. All output will be labeled with the program’s title and a short description 
of each figure. 


BAR CHARTS: 

CDB1 - Additive and absolute bars - multiple data sets B - 3 

CDB2 - Absolute bars - multiple data sets B - 7 

CDB3 - Additive bars - multiple data sets B - 11 

CDB4 - Additive bars - multiple data sets, with a legend B- 15 

COMPOSITE CHART: 

CDC1 - Composite chart (i.e., two charts on one page) B- 19 

PIE CHARTS: 

CDP1 - Basic pie chart B - 23 

CDP2 - Exploded pie chart B - 27 

CDP3 - Basic pie chart with a legend B - 31 

LINE CHARTS: 

CDR1 - Simple program to demonstrate symbols and polygon 

fill patterns B - 35 

CDR2 - Simple program to demonstrate symbols and polygon 

symbol sizes B - 37 

CDR3 - Simple program to demonstrate how to generate 

a set of axes B - 39 

CDR4 - Basic line chart B - 41 

CDR5 - Complete line chart B - 44 

CDR6 - Complete line chart with a legend B - 47 

CDR7 - Semi-logarithmic line chart (single data set) B - 50 

CDR8 - Log-log line chart (multiple data sets) B - 53 

CDR9 - Line chart with a grid (without a legend) B - 56 

CDR10 - Semi-log line chart with a grid (single data set) B - 59 

CDR1 1 - Complete low-level program (with a key) and a grid B - 62 

CDR1 2 - Line chart with a dereasing axis B - 66 

CDR13 - Line chart with multiple vertical scales on the same axis B - 69 

CDR14 - Line chart with multiple vertical scales (opposite axis) B - 73 

CDR15 - Simple, yet complete low-level program (with a key) B - 77 


B - 1 


CDR16- Line chart with disjoint axes (based on CDR4) B- 81 

DEBUG PRORAMS: 

CDD1 - Example showing a simple CGL error B - 84 

CDD2 - Example showing debugging capabilities B - 87 

CDD3 - Example showing an error and debugging redirection B - 90 

COMBINATION OF HIGH AND LOW LEVEL PROGRAMS: 

CDLL1 - Program interfacing the low-level routines with the 

LEZ Routines B - 93 

CDLL2 - Program interfacing the low-level routines with the 

LEZ Routines B - 96 

CDLL3 - Program interfacing the low-level routines with the LEZ 
Routines (This program is CDLL1 modified to 
CALL CLGRID(log-log) .) B - 1 00 

CDLL4 - Program interfacing the low-level routines with the LEZ 
Routines (This program is CDLL3 modified to 

CALL CLGRID(semi-log).) B - 104 


B - 2 






Figure CDB1 . Additive and absolute bars - multiple data sets. 


B - 3 


cocccl 


o o 


PROGRAM CDB1 


C 

C ADDITIVE AND ABSOLUTE BARS - MULTIPLE DATA SETS 

C 

C SET UP 'PLOT CONSTANTS 

PARAMETER (XWMAX=1 1 ,0,YWMAX=1 1 .0,CSIZE=. 1 5) 
PARAMETER (XBEG=1 ,5,YBEG=1 . 5 , XLEN=8 . 5 , YLEN=5 .0 ) 


C ALLOCATE STORAGE AND INITIALIZE VARIABLES 
PARAMETER* NUMSET=3,NUMPTS=20) 

INTEGER ID(NUMSET) 

REAL REVCRU(NUMSET,NUMPTS) , TOTAL (NUMPTS) 
CHARACTER MONTHS ( 0: 37) *3 
DATA ID/0,1 ,0/ 


DATA MONTHS/' 

’ t 1 JAN 1 

9 

FEB' , 'MAR' 

9 

'APR' 

9 

'MAY' 

9 

JUN' 



*> 

+ 

' JUL* 

9 

'AUG' , 'SEP' 

9 

'OCT' 

9 

'NOV' 

f 

'DEC' 




+ 

'JAN' 

9 

'FEB' , 'MAR' 

9 

'APR' 

9 

'MAY' 

9 

'JUN' 




+ 

'JUL* 

9 

'AUG* , 'SEP' 

9 

'OCT' 

9 

'NOV' 

9 

'DEC' 




+ 

'JAN' 

9 

'FEB' , 'MAR' 

9 

'APR' 

9 

'MAY' 

9 

•JUN' 



- 

-1- 

'JUL* 

9 

'AUG' , 'SEP' 

9 

'OCT' 

9 

'NOV' 

9 

'DEC' 

1 

V 



DO 9 1=1 , NUMSET 
DO 9 J=1, NUMPTS 
9 REVCRU ( I , J ) =RANF ( ) * 1 0 . 

C 

C INITIALIZE DI3000 AND CGL 
CALL JBEGIN 
CALL CBEGIN 
IDEV=0 

CALL JOIN IT ( IDEV ) 

CALL JDEVON ( IDEV ) 


SET WINDOW AND VIEWPORT FOR PAGE AREA 
CALL CVS P AC ( XWMAX , YWMAX ) 

CALL JWINDO(0. , XWMAX, 0. , YWMAX) 

CALL JOPEN 

C — 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

C HORIZONTAL AXIS 

CALL JMOVE( XBEG, YBEG) 

CALL CHTROT( 45 ) 

IMONTH1 =8 

CALL CHAXIC( XLEN, NUMPTS+2 , MONTHS ( IMONTH1-1 ) , 1 ,NUMPTS+2) 

C YEARS 

XINCR=XLEN/REAL ( NUMPTS+2-1 ) 

CALL JMOVE( XBEG, YBEG- ( (CSIZE*1 ,25)+(3. *CSIZE)+(CSIZE*1 .25) ) ) 
CALL JJUST( 2,3) 

CALL JHSTRG( '83’ ) 

IF( I MONTH 1 .NE.1 )THEN 

DIST=REAL( (1 2-IMONTH1 )+2) 

CALL JRMOVE(DIST*XINCR,0. ) 

CALL JHSTRG( '84' ) 

END IF 

CALL JRMOVE( 1 2. *XINCR,0. ) 

CALL JHSTRG( '85' ) 


B - 4 



DO DO O O 




C VERTICAL AXIS - ON LEFT OF PLOT 
CALL JMOVE ( XBEG , Y B EG ) 

CALL CVLAB( 'CRU[BLC]S ( [BLC] THOUSANDS) 1 ) 

icr=o 

DO 101 1=2 ,NUMSET 
101 IF (ID(I).EQ.I) ICT=ICT+1 

VMAX=1 0. *REAL(NUMSET-ICT) 

CALL CVAXIS ( 0 • , VMAX, 5 . , YLEN) 

C VERTICAL AXIS - ON RIGHT OF PLOT 
CALL JMOVE( XBEG+XLEN, YBEG) 

CALL CVLAB( ’ ' ,0) 

CALL CVJUST(O) 

CALL CVLABJ ( 1 ) 

CALL CVAXIS ( 0. , VMAX, 5. , YLEN) 


DRAW MISC. TEXT OVER PLOT 

YOFF= ( 2 . ‘CSIZE+5 . *CSIZE) 

CALL JMOVE( XBEG+XLEN/2 • ,YBEG+YLEN+YOFF) 

CALL JJUST( 2 , 1 ) 

CALL JSIZE( 1 . 5*CSIZE, 1 .5*CSIZE*1 .25) 

CALL JHSTRG( ' REVENUE CRUS') 

CALL JRMOVE(0. ,-2.*CSIZE*1 .25) 

CALL JHSTRG( 'DAILY AVERAGE - MONTHLY BY MACHINE') 
CALL JMOVE (XBEG+CSIZE,YBEG+ YLEN) 

CALL JJUST(1 ,3) 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

CALL JHSTRG('CY 175') 


SAVE OFF VIRTUAL COORDINATES OF DATA AREA (FROM AXES) 
CALL JCONWV (XBEG, YBEG, 0. , XVI ,YV1 ) 

CALL JCONWV ( XBEG+XLEN , YBEG+YLEN , 0 . , XV2 , YV2 ) 

CALL JCLOSE 


SET WINDOW AND VIEWPORT FOR DATA AREA 
CALL JVPORT( XVI , XV2 , YV1 , YV2) 

CALL JWI NDO ( 0 . , REAL ( NU MPTS+ 1 ) ,0. ,VMAX) 

C OPEN SEGMENT, AND PLOT BARS 
CALL JOPEN 
CALL JPINTRO ) 

C THE WIDTH OF BARS AT A SINGLE TICK MARK IS DETERMINED 
C BY THE LENGTH OF THE AXIS (IN DATA COORDINATES) DIVIDED 
C BY THE NUMBER OF INTERVALS TIMES A FRACTION (2/3). 

C XWIDTH=( ( NUMPTS+1 ) /REAL(NUMPTS+2-1 ) )*(2./3. ) 

C NOTE IF THE WORLD IS FROM 0 TO A VALUE, THEN XWIDTH=2/3. 
XWIDTH= 2./3. 

XBARW=XWIDTH/REAL ( NUMSET-ICT ) 

DO 99 1=1 , NUMPTS 
99 TOTAL ( I ) =0 . 0 

ICT=1 

DO 2 1=1 , NUMSET 

CALL JPIDEX( I , 48-1 ) 

XOFF=-XWIDTH/2 . + REAL( ICT-1 ) *XBARW 
IF ( ID ( I ) . EQ. 1 ) ICT=ICT+1 


o n 


DO 2 J=1 ,NUMPTS 

CALL JRECT ( REAL { J ) +XOFF , TOTAL ( J ) , REAL ( J ) +XOFF+XBARW , 
+ TOTAL ( J ) +REVCRU ( I , J ) ) 

IF .( ID ( 1+1 ) . EQ. 1 ) THEN 

TOTAL ( J ) = TOTAL ( J ) +REVCRU ( I , J ) 

ELSE 

TOTAL ( J ) =0 . 

END IF 
2 CONTINUE 


TERMINATE DI3000 AND CGL 
CALL JCLOSE 
CALL JFRAME 
CALL JDEVOF(IDEV) 
CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


B - 6 



CRUs 



Figure CDB2. Absolute bars - multiple data sets. 


B - 7 


o o on 


PROGRAM CDB2 




C ABSOLUTE BARS - MULTIPLE DATA SETS 

C 7 

C SET UP' PLOT CONSTANTS 

PARAMETER(XWMAX=1 1 .0, YWMAX=1 1 .0 ,CSIZE= . 1 5 ) 
PARAMETER ( XBEG=1 .5,YBEG=1 .5,XLEN=8.5 -YLEN=5.0) 


C ALLOCATE STORAGE AND INITIALIZE VARIABLES 
PARAMETER(NUMSET=3,NUMPTS=20) 

REAL REVCRU ( NUMS ET , NUMPTS ) 

CHARACTER MONTHS ( 0 : 3 7 ) * 3 , VALUES ( 3 ) * 2 


DATA MONTHS/' 

' , ' JAN ' 

, 'FEB' 

t 

'MAR' 

, 'APR' 

r 

'MAY' 

/ 

•JUN' 


+ 

'JUV 

, 1 AUG ' 

9 

•SEP' 

, ' OCT 

/ 

’NOV' 

9 

'DEC' 


+ 

'JAN' 

, 'FEB' 

r 

'MAR' 

, 'APR* 

f 

'MAY' 

9 

'JUN' 


+ 

' JUL' 

, 'AUG' 

9 

'SEP' 

, ' OCT * 

9 

’NOV' 

9 

'DEC' 


+ 

'JAN' 

, 'FEB' 

9 

’MAR' 

, 'APR' 

9 

'MAY' 

9 

'JUN' 


+ 

'JUL' 

, 'AUG* 

t 

’SEP' 

, 'OCT' 

9 

'NOV' 

9 

'DEC' 



DATA VALUES/’ 0’,’ 5’ ,’10’/ 
DO 9 1=1, NUMS ET 
DO 9 J=1, NUMPTS 
9 REVCRU ( I , J ) =RANF ( ) * 1 0 . 


INITIALIZE DI3000 AND CGL 
CALL JBEGIN 
CALL CBEGIN 
IDEV=0 

CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 


SET WINDOW AND VIEWPORT FOR PAGE AREA 
CALL CVSPAC( XWMAX , YWMAX) 

CALL JWINDO(0. , XWMAX, 0- , YWMAX) 

CALL JOPEN 

C 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

C HORIZONTAL AXIS 

CALL JMOVE( XBEG, YBEG) 

CALL CHTROT(45) 

IMONTH1 =8 

CALL CHAXIC(XLEN,NUMPTS+2, MONTHS ( IMONTH1 -1 ) , 1 ,NUMPTS+2) 

C YEARS 

XINCR=XLEN/REAL(NUMPTS+2-1 ) 

CALL JMOVE( XBEG, YBEG- ( (CSIZE*1 .25)+(3.*CSIZE)+(CSIZE*1 .25) ) ) 
CALL J JUST (2, 3) 

CALL JHSTRG( ’83’ ) 

IF( IMONTH1 .NE.1 )THEN 

DIST=REAL( ( 1 2-IMONTH1 )+2) 

CALL JRMOVE(DIST*XINCR, 0 . ) 

CALL JHSTRG ( *84’ ) 

END IF 

CALL JRMOVE( 12. *XINCR, 0 . ) 

CALL JHSTRG ( ’85' ) 

C 


B - 8 



no oooooooo on no 


C VERTICAL AXIS - ON LEFT 

CALL JMOVE (XBEG, YBEG) 

CALL CVL AB ( ' CRU [ BLC ] S ( [BLC) THOUSANDS )’, 1 ) 
CALL CVAXIC(YLEN,3 , VALUES, 1 ,3) 

C VERTICAL AXIS - ON RIGHT 

CALL JMOVE( XBEG+XLEN, YBEG) 

CALL CVLAB( ' ’ ,0) 

CALL CVJUST(O) 

CALL CVLABJ ( 1 ) 

CALL CVTICJ ( 2 ) 

CALL CVAXIC (YLEN, 3, VALUES ,1 ,3) 


DRAW MI SC. TEXT OVER PLOT 

YOFF=( 2 . *CSIZE+5 . *CSIZE) 

CALL JMOVE ( XBEG+ XLEN/2 . , YBEG+YLEN+ YOFF ) 

CALL JJUST(2, 1 ) 

CALL JSIZEO . 5*CSIZE, 1 .5*CSIZE*1 .25) 

CALL JHSTRG( 'REVENUE CRUS') 

CALL JRMOVE(0. ,-2.*CSIZE*1 .25) 

CALL JHSTRGC 'DAILY AVERAGE - MONTHLY BY MACHINE') 
CALL JMOVE ( XBEG+CSIZE,YBEG+YLEN) 

CALL JJUST( 1,3) 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

CALL JHSTRG( 'CY 175' ) 


SAVE OFF VIRTUAL COORDINATES OF DATA AREA (FROM AXES) 
CALL JCONWV(XBEG, YBEG, 0. , XVI ,YV1 ) 

CALL JCONWV ( XBEG+XLEN , YBEG+YLEN , 0 • ,XV2,YV2) 

CALL JCLOSE 


SET WINDOW AND VIEWPORT FOR DATA AREA 
CALL JVPORT ( XVI , XV2 , YV1 , YV2 ) 

CALL JWINDO{ 0 . , REAL ( NUMPTS+1 ) ,0. , 10. ) 

OPEN SEGMENT, AND PLOT BARS 
CALL JOPEN 
CALL JPINTR ( 1 ) 

THE WIDTH OF BARS AT A SINGLE TICK MARK IS DETERMINED 
BY THE LENGTH OF THE AXIS (IN DATA COORDINATES) DIVIDED 
BY THE NUMBER OF INTERVALS TIMES A FRACTION (2/3). 

XWIDTH=( (NUMPTS+1 ) /REAL( NUMPTS+2- 1 ) )*(2./3. ) 

NOTE IF THE WORLD IS FROM 0 TO A VALUE, THEN XWIDTH=2/3. 
XWIDTH= 2./3. 

XBARW=XW IDTH/REAL ( NUMS ET ) 

DO 2 1=1 , NUMSET 

CALL JPIDEX( I , 48-1 ) 

XOFF=-XWIDTH/2 . + REAL ( 1-1 ) *XBARW 
DO 2 J=1 , NUMPTS 

2 CALL JRECT(REAL( J)+XOFF,0. ,REAL( J)+XOFF+XBARW,REVCRU( I, J) ) 


TERMINATE DI3000 AND CGL 
CALL JCLOSE 
CALL JFRAME 
CALL JDEVOF(IDEV) 
CALL JDENO(IDEV) 

CALL JEND 


B - 9 




B 


PRECEDING PAGE BLANK NOT FILMED 


I 


PROGRAM CDB3 



C ADDITIVE BARS - MULTIPLE DATA SETS 

C r 

C SET UP PLOT CONSTANTS 

PARAMETER ( XWMAX=1 1 .0,YWMAX=1 1 .0 ,CSIZE= . 1 5 ) 
PARAMETER (XBEG=1 .5,YBEG=1 .5 , XLEN=8 . 5 , YLEN=5 .0 ) 

C 

C ALLOCATE STORAGE AND INITIALIZE VARIABLES 
PARAMETER(NUMSET=3,NUMPTS=20) 

REAL REVCRU ( NUMSET , NUMPTS ) , TOTAL ( NUMPTS ) 
CHARACTER MONTHS ( 0 : 37 ) *3 


DATA MONTHS/ 1 

' , ' JAN ’ 

, 'FEB' 

9 

'MAR' 

9 

'APR' 

9 

'MAY' 


JUN' 


+ 

'JUL' 

, 'AUG' 

9 

'SEP' 

9 

'OCT' 

9 

'NOV' 


'DEC' 


+ 

'JAN' 

, 'FEB' 

9 

'MAR' 

9 

'APR' 

9 

'MAY' 


'JUN' 


+ 

'JUL' 

, 'AUG' 

9 

'SEP' 

9 

'OCT' 

9 

'NOV' 


'DEC' 



'JAN' 

, 'FEB' 

9 

'MAR' 

1 

9 

'APR' 

1 

9 

'MAY* 


•JUN' 

1 

+ 

'JUL' 

, 'AUG' 

9 

'SEP' 

1 

9 

'OCT' 

9 

'NOV' 


'DEC' 

1 


DO 9 1=1, NUMSET 
DO 9 J=1 , NUMPTS 
9 REVCRU ( I , J ) =RANF ( ) * 1 0 . 



C INITIALIZE DI3000 AND CGL 
CALL JBEGIN 
CALL CBEGIN 
IDEV*0 

CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 



C SET WINDOW AND VIEWPORT FOR PAGE AREA 
CALL CVSPAC ( XWMAX , YWMAX ) 

CALL JWIND0(0. , XWMAX, 0. , YWMAX) 

CALL JOPEN 



CALL JSIZE(CSIZE,CSIZE*1 .25) 

C HORIZONTAL AXIS 

CALL JMOVE ( XBEG , YBEG ) 

CALL CHTROT( 45 ) 

IMONTH1 =8 

CALL CHAXIC(XLEN,NUMPTS+2, MONTHS ( IMONTH1 -1 ) , 1 ,NUMPTS+2) 

C YEARS 

XINCR=XLEN/REAL( NUMPTS+2-1 ) 

CALL JMOVE ( XBEG , YBEG- ( (CSIZE*1 . 25)+ ( 3 . *CSIZE) + (CSIZE*1 .25) ) ) 
CALL JJUST( 2 , 3 ) 

CALL JHSTRG( '83' ) 

IF( IMONTH1 .NE.1 )THEN 

DIST=REAL( ( 1 2-IMONTH1 ) +2) 

CALL JRMOVE(DIST*XINCR,0. ) 

CALL JHSTRG( '84' ) 

ENDIF 

CALL JRMOVE (12.* XINCR , 0 . ) 

CALL JHSTRG( '85' ) 



C VERTICAL AXIS - LABEL ON LEFT OF AXIS 


B - 12 



on ooooooooo no on 


CALL JMOVE ( XBEG, YBEG) 

CALL CVLAB ( 1 CRU ( BLC ] S ( (BLC] THOUSANDS) ', 1 ) 
CALL CVAXIS(0. ,30. ,5.,YLEN) 

C VERTICAL AXIS - LABEL ON RIGHT OF AXIS 
CALL JMOVE ( XBEG+XLEN , YBEG ) 

CALL CVLAB ( ' ' ,0) 

CALL CVJUST(O) 

CALL CVLAB J ( 1 ) 

CALL CVAXIS(0.,30. ,5. ,YLEN) 


DRAW MISC. TEXT OVER PLOT 

YOFF= ( 2 . ‘CSIZE+5 . *CSIZE) 

CALL JMOVE ( XBEG+XLEN/2 . , YBEG+YLEN+YOFF) 

CALL JJUST(2, 1 ) 

CALL JSIZE( 1 .5*CSIZE, 1 .5*CSIZE*1 .25) 

CALL JHSTRG( 'REVENUE CRUS') 

CALL JRMOVE(0. ,-2.*CSIZE*1 .25) 

CALL JHSTRG( 'DAILY AVERAGE - MONTHLY BY MACHINE’) 
CALL JMOVE (XBEG+CSIZE,YBEG+YLEN) 

CALL JJUST(1 ,3) 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

CALL JHSTRGCCY 175') 


SAVE OFF VIRTUAL COORDINATES OF DATA AREA (FROM AXES) 
CALL JCONWV (XBEG, YBEG, 0., XVI ,YV1 ) 

CALL JCONWV ( XBEG+XLEN , YBEG+YLEN , 0 . , XV2 , YV2) 

CALL JCLOSE 


SET WINDOW AND VIEWPORT FOR DATA AREA 
CALL JVPORT(XV1 ,XV2,YV1 ,YV2) 

CALL JWINDO ( 0 . , RE AL ( NUMPTS+ 1 ) , 0 . , 3 0 . ) 


OPEN SEGMENT, AND PLOT BARS 
CALL JOPEN 
CALL JPINTRO ) 

THE WIDTH OF BARS AT A SINGLE TICK MARK IS DETERMINED 
BY THE LENGTH OF THE AXIS (IN DATA COORDINATES) DIVIDED 
BY THE NUMBER OF INTERVALS TIMES A FRACTION (2/3). 

XWIDTH=( (NUMPTS+1 )/REAL(NUMPTS+2-1 ))M2./3.) 

NOTE IF THE WORLD IS FROM 0 TO A VALUE, THEN XWIDTH=2/3. 
XWIDTH= 2./3. 

XHALF=XWIDTH/2 . 

DO 99 1=1 ,NUMPTS 
99 TOTAL ( I) =0.0 

DO 2 1=1 ,NUMSET 

CALL JPIDEX( I , 48-1 ) 

DO 2 J=1 , NUMPTS 

CALL JRECT ( REAL ( J ) - XHALF , TOTAL ( J ) , 

+ REAL (J)+XHALF, TOTAL (J)+REVCRU( I, J) ) 

2 TOTAL ( J ) =TOTAL ( J ) +REVCRU ( I , J ) 


TERMINATE DI3000 AND CGL 
CALL JCLOSE 
CALL JFRAME 


B - 13 


CALL JDEVOF(IDEV) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


B - 14 



CRUs (thousands) 


-avail p.=>m 
YTSSS//A -avail 

f -USE 


REVENUE CRUS 

DAILY AVERAGE - MONTHLY BY MACHINE 



Figure CDB4. Additive bars - multiple data sets, with a legend. 


B - 15 


o o n o o o 


PROGRAM CDB4 


c 

C ADDITIVE BARS - MULTIPLE DATA SETS, WITH A LEGEND. 

C 

C SET UP PLOT CONSTANTS 

PARAMETER ( XWMAX=1 1 .0,YWMAX*1 1 .0) 

PARAMETER ( XBEG= 1 . 5 , YBEG= 1.5: 

PARAMETER ( XLEN=8 . 5 , YLEN=5 . 0 ) 

PARAMETER ( CS I ZE= . 1 5 ) 


ALLOCATE STORAGE AND INITIALIZE VARIABLES 
PARAMETER (NUMSET=3,NUMPTS=20) 

REAL REVCRU ( NUMSET , NUMPTS ) , TOTAL ( NUMPTS ) 

PARAMETER( NLINES =4 ,NCOLS=1 ,NTLINES=1 ) 

CHARACTER KEYCHR ( NCOLS , NLINES ) *9 , KEYLAB ( NLINES ) *9 
INTEGER ISTORE( 15, NLINES ), JCOL( 1 ) 

REAL BPOS ( 4 ) 

CHARACTER MONTHS (12) *3, VALUES ( 3 ) *2 

DATA MONTHS/' JAN’ , 'FEB' 'MAR' , ' APR' , 'MAY' , ' JUN' , 

+ 'JUL' , 'AUG' , 'SEP' , 'OCT' , 'NOV' , 'DEC'/ 

DATA VALUES/' 0',' 5 ','10'/ 

DATA KEYLAB(1 ) /' -AVAIL+PM' / ,KEYLAB{ 2 ) / ' -AVAIL '/ 

DATA KEYLAB ( 3 ) / ' -USE ' / , KEYLAB ( 4) / ' -PROD '/ 

DATA JCOL/1/ 

DO 9 1=1, NUMSET 
DO 9 J=1, NUMPTS 
i REVCRU (I , J)=RANF( ) *3. 


INITIALIZE DI3000 AND CGL 
CALL JBEGIN 
CALL CBEGIN 
CALL CDEBUGO ) 

IDEV=0 

CALL JDINIT(IDEV) 

CALL JDEVON(IDEV) 


SET WINDOW AND VIEWPORT FOR PAGE AREA 
CALL JVSPAC(-1.,1.,-1.,1.) 

CALL JWINDO(0. ,XWMAX,0. ,YWMAX) 

CALL JOPEN 

C 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

C HORIZONTAL AXIS 

CALL JMOVE ( XBEG , YBEG ) 

CALL CHLABJ ( 1 ) 

CALL CHAXIC( XLEN , 2 , ' ',0, NUMPTS) 

C MONTHS 

XINCR=XLEN/REAL(NUMPTS+2-1 ) 

CALL JMOVE( XBEG, YBEG-2. *CSIZE*1 .25) 
CALL JJUST( 3,2) 

CALL CSETBP( 90 . ) 

IMONTH1 =8 

DO 1 KI=1, NUMPTS 

IMONTH=KI+IMONTH1 - 1 


B - 16 



noon on no 


IMONTH=MOD ( IMONTH ,12) 

IF ( IMONTH . EQ. 0 ) IM0NTH»1 2 
CALL JRMOVE ( XINCR , 0 . ) 

1 CALL JHSTRG (MONTHS (IMONTH ) ) 

CALL CSETBP( 0. ) 

CALL JSETDB(O) 

C YEARS 

CALL JMOVE ( XBEG , YBEG- ( (CSIZE*1 .25)+(3.*CSIZE)+(CSIZE*1 .25) ) ) 
CALL JJUST( 2 , 3) 

CALL CSETBP(0.) 

CALL JHSTRG ( '83' ) 

IF( IMONTH1 .NE.1 )THEN 

DIST=REAL( ( 1 2-IMONTH1 ) +2) 

CALL JRMOVE (D 1ST *XINCR,0. ) 

CALL JHSTRG ( '84' ) 

END IF 

CALL JRMOVE (1 2. *XINCR, 0. ) 

CALL JHSTRG ( ’85' ) 


VERTICAL AXIS 

CALL JMOVE (XBEG, YBEG) 

CALL CVLAB ( ' CRU [ BLC ] S ( [BLC] THOUSANDS) ', 1 ) 
CALL CVAXIC(YLEN, 3, VALUES, 1 ,3) 

CALL JMOVE (XBEG+XLEN, YBEG) 

CALL CVLAB ( * ' ,0) 

CALL CVJUST ( 0 ) 

CALL CVLAB J( 1 ) 

CALL CVTICJ(2) 

CALL CVAXIC( YLEN, 3 , VALUES ,1,3) 


DRAW MI SC. TEXT OVER PLOT 

YOFF= ( 2 . *CSIZE+5 . *CSIZE) 

CALL JMOVE (XBEG+XLEN/ 2. , YBEG+YLEN+YOFF) 

CALL JJUST( 2,1) 

CALL JSIZE( 1 . 5*CSIZE, 1 .5*CSIZE*1 .25) 

CALL JHSTRG ( 'REVENUE CRUS') 

CALL JRMOVE (0. ,-2.*CSIZE*1 .25) 

CALL JHSTRG ( 'DAILY AVERAGE - MONTHLY BY MACHINE') 
CALL JMOVE ( XBEG+CSIZE , YBEG+YLEN ) 

CALL JJUSTO ,3) 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

CALL JHSTRG ( 'CY 175' ) 


SAVE OFF VIRTUAL COORDINATES OF DATA AREA (FROM AXES) 
CALL JCONWV ( XBEG, YBEG, 0.,X1,Y1) 

CALL JCONWV (XBEG+XLEN,YBEG+ YLEN, 0. ,X2,Y2) 

CALL JCLOSE 


SET WINDOW AND VIEWPORT FOR DATA AREA 
CALL JVPORT(X1 ,X2,Y1 ,Y2) 

CALL JWINDO(0. , REAL( NUMPTS+1 ) ,0. ,10. ) 

C OPEN SEGMENT, AND PLOT BARS 
CALL JOPEN 

CALL CKEYIN ( ISTORE,KEYCHR, NLINES , NCOLS ,NTLINES ) 


B - 17 



n o 


CALL JPINTR(I) 

XWIDTH=2./3. 

XHALF=XWIDTH/2. 

DO 99 1=1 ,NUMPTS 
99 TOTAL ( I ) =0 . 0 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

DO 2 1=1 , NUMSET 

CALL JPIDEX( 1,47 — (I— 1 ) ) 

CALL CKEYLB ( ISTORE, KEYCHR, -4 , KEYLAB( I ) ) 

DO 2 J=1 ,NUMPTS 

CALL JRECT(REAL( J) -XHALF,TOTAL( J) , 

+ REAL ( J ) +XHALF , TOTAL ( J ) +REVCRU ( I , J ) ) 

2 TOTAL ( J ) =TOTAL ( J ) +REVCRU ( I , J ) 

CALL JCLOSE 

C 

C NOW OUTPUT LEGEND 

C SET WINDOW AND VIEWPORT FOR PAGE AREA 
CALL JSETDB(O) 

CALL JVPORT (-1 . ,1 .,-.773, .773) 

CALL JWINDO(0. ,10. ,0. ,7.73) 

BPOS ( 1 ) =XBEG+XLEN 
BPOS ( 2 ) =YBEG+YLEN 
CALL JOPEN 

CALL JS IZE(CSIZE, CS IZE* 1 .25) 

C CALL CKLPLN ( . 08 ) 

CALL CKEYPL( I STORE, KEYCHR, ' ' , BPOS, 3 , JCOL, 0) 

CALL JCLOSE 


TERMINATE DI3000 AND CGL 
CALL JPAUSE(IDEV) 
CALL JFRAME 
CALL JDEVOF ( IDEV ) 
CALL JDEND ( IDEV ) 

CALL JEND 

STOP 

END 


B - 18 




o o no 


PROGRAM CDC1 




C COMPOSITE CHART (IE, TWO CHARTS ON ONE PAGE) 



C ALLOCATE AND INITIALIZE DATA 

PARAMETER ( MAX PTS= 1 0,MAXSET=4) 

REAL X( MAXPTS , MAXSET) , Y(MAXPTS , MAXSET ) 

DATA (X(KI,1 ),KI=1,10) 

+ /0. , .1 , .2, .3, .4, .5, .6, .7, .8, .9/ 

DATA (X(KI,2) ,KI=1 ,10) 

+ /.I , .15, .3, .35, .45, .55, .65, .75, .85,1 .2/ 

DATA(X(KI, 3) ,KI=1 ,10) 

4 1 / .0, .1 , .2, .3, .4, .5, .6, .7, .8, .8/ 

DATA( X( KI , 4 ) ,KI=1 ,10) 

+ / .1 , .2, .4, .6, .7, .8, .9,1 . ,1 .1 ,1 .2/ 

DATA ( Y(KI, 1 ) ,KI=1 ,10) 

+ /0., 2. ,4. ,7. ,10. ,12. ,15. ,18. ,21. ,24./ 

DATA (Y(KI,2),KI*1,10) 

+ /I .,3., 5., 8., 11 .,13., 16. 5, 20., 22., 23./ 

DATA ( Y(KI , 3 ) ,KI=1 ,10) 

+ /0. , .005, .01 , .015, ,02, .025, .029, .03, .035, .04/ 

DATA ( Y(KI , 4 ) ,KI=1 ,10) 

+ /-.005,-.01 ,-.01 5, -.02, -.025, -.03, -.04, -.05, -.065, -.08/ 


WRITE TO THE DEVICE IDEV 
IDEV=0 
CALL CBEGIN 
CALL JBEGIN 
CALL JDINIT(IDEV) 
CALL JDEVON ( IDEV ) 


ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
XS= . 2 
YS=6 .0 

CALL CVSPAC ( 1 0. , 1 0 . ) 

CALL J4RGET( 2, VX3 , VX4 , VY3 ,VY4) 

CALL JWINDO(0. ,10. ,0. ,10. ) 

CALL JOPEN 

C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 

CALL JSIZE(XS,XS*1 .25) 

C POSITION TEXT, AND SET TTEXT JUSTIFICATION (CENTER, CENTER) 
CALL JMOVE(5.0, 10.0) 

CALL JJUST(2, 3) 

C OUTPUT THE STRING 

CALL JHSTRG ( ' A T[BLC] ITLE' ) 

C RESET THE CHARACTER SIZE FOR THE AXES 
CALL JSIZE(XS,XS*1 .25) 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
XORG=2 . 

YORG=2 .0 

CALL JMOVE ( XORG , YORG ) 

C DESCRIBE THE HORIZONTAL AXIS 
CALL CHLAB ( ' C [ BSUB ) L * ,1 ) 

CALL CHTICJ ( 1 ) 


B - 20 



n n 


C XLEN-REPRESENTS THE X-AXIS LENGTH 
XLEN=6.0 
CALL CHPREC ( 1 ) 

CALL CHAXIS(-.2,1 .2, .2,XLEN) 

C DESCRIBE THE VERTICAL AXIS 

CALL CVLAB( ' [F0NT=9] [BLC] A[F0NT=3] , DEG* , 1 ) 

CALL CVPREC( 3) 

CALL CVTICJ(I) 

C YLEN-REPRESENTS THE Y-AXIS LENGTH 
YLEN=3.5 
CALL CVPREC(-I) 

CALL CVJUST(1 ) 

CALL CVAXIS(-4.,24.,4.,YLEN) 

C SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV(XORG,YORG,0. ,VX1 ,VY1 ) 

CALL JCONWV ( XORG+XLEN , YORG+YLEN , 0 . ,VX2,VY2) 

C CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES) 

CALL JCLOSE 

C 

C SET WINDOW TO MATCH DATA COORDINATES, AND PLOT WITHIN BOUNDARIES 
C OF THE AXES (BY SAVED VIRTUAL COORDINATES) 

CALL JWINDO (-.2,1 .2, -4., 24.) 

C -.2,1.2 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE X-DIRECTION 
C -4., 24. - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE Y-DIRECTION 
CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 

C PLOT FIRST DATA CURVE 
CALL CSYMNO(I) 

CALL CLNPAT(I) 

CALL CLNPLT ( X , Y ( 1 , 1 ) , MAXPTS ) 

C SET SYMBOL NUMBER TO 902, AND PLOT SECOND DATA CURVE 
CALL CSYMNO( 2 ) 

CALL CLNPAT( 2 ) 

CALL CLNPLT ( X , Y ( 1 , 2 ) , MAXPTS ) 

CALL JCLOSE 


WORK ON SECOND GRAPH 

CALL JWINDO(0. ,10. ,0. ,10.) 

CALL JVPORT ( VX3 , VX4 , VY3 , VY4 ) 

CALL JOPEN 

CALL JSIZE(XS ,XS*1 .25) 

CALL JMOVE( XORG , YS ) 

C YLEN-REPRESENTS THE Y-AXIS LENGTH 
CALL CVLAB( 'ClBSUB] [BLC)M‘ , 1 ) 

CALL CVPREC( 2 ) 

CALL CVAXIS(-.08, .04, .04,YLEN) 

C SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV ( XORG, YS,0. ,VX1 ,VY1 ) 

CALL JCONWV ( XORG+XLEN , YS+3 . 5,0. ,VX2,VY2) 

C CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES) 

CALL JCLOSE 

c 

C SET WINDOW TO MATCH DATA COORDINATES AND PLOT WITHIN BOUNDARIES 
C OF THE AXES (BY SAVED VIRTUAL COORDINATES) 


B - 21 



CALL JWIND0(-.2,1 .2, -.08, .04) 
CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 
CALL JOPEN 

C PLOT THIRD DATA CURVE 
CALL CSYMNO(1 ) 

CALL CLNPAT ( 1 ) 

CALL CLNPLT(X,Y( 1 ,3) ,MAXI*’S) 

C PLOT FOURTH SET OF DATA POINTS 
CALL CSYMNO( 2 ) 

CALL CLNPAT ( 2 ) 

CALL CLNPLT ( X , Y ( 1 , 4 ) , MAXPTS ) 
CALL JCLOSE 

C 

C TERMINATE GRAPHICS 

CALL JPAUSE(IDEV) 

CALL J FRAME 
CALL JDEVOF (ID EV ) 

CALL JDEND(IDEV) 

CALL JEND 
STOP 




Figure CDPl . Basic pie chart. 


B - 23 




o o o o no non no on 


PROGRAM CDP1 




C BASIC PIE CHART 

C 

C INITIALIZE DATA 

REAL OFFS ET, RADI ,RAD2,RAD3,RAD4 
REAL XV ( 4 ) , YV ( 4 ) , ZV ( 4 ) , REGION ( 8 ) 
CHARACTER* 14 LABEL (8 ) 

CHARACTER*4 YEAR 


INITIALIZE DATA 

DATA OFFSET, RADI ,RAD2,RAD3,RAD4 /. 25, 2. ,2.35,2.85,2.95/ 

DATA REGION ( 1 ) , REGION ( 2 ) , REGION ( 3) , REGION ( 4) /21 . ,6. , 24. , 28 ./ 
DATA REG ION ( 5 ) ,REGION(6) ,REGION(7) , REGION ( 8 ) /4 . ,1 3. ,1 8. ,32./ 

DATA YEAR /’I 988’/ 

DATA LABEL (1 ) / ' N [ BLC ] ICKEL ' / 

DATA LABEL ( 2)/ ' M[ BLC] AGNES IUM' / 

DATA LABEL ( 3 ) / ' A [ BLC ] LUMINUM 1 / 

DATA LABEL ( 4 ) / ' G ( BLC ] OLD ' / 

DATA LABEL ( 5 ) / * It BLC ] RON ' / 

DATA LABEL ( 6 ) / 1 S [ BLC ] ILVER 1 / 

DATA LABEL ( 7 ) / ' C [BLC] OPPER' / 

DATA LABEL ( 8 ) / ' L [ BLC ] EAD 1 / 


INITIALIZE DI-3000 
CALL JBEGIN 

WRITE TO THE DEVICE IDEV 
IDEV=0 

CALL JDINIT(IDEV) 
CALL JDEVON ( IDEV ) 


DEFINE THE VIEWSPACE AND WINDOW OF SAME ASPECT RATIO 
CALL JVSPAC(-1 .,1 .,-1 .,1 .) 

CALL JWINDO (0.,10.,0.,10.) 


FILL POLYGONS BY DEFAULT. 
CALL JDPINT(I) 


OPEN A TEMPORARY SEGMENT FOR BORDERS. 
CALL JOPEN 

CALL JIWIND ( XV , YV , ZV ) 

CALL JPIDEX( 4 , 0 ) 

CALL JPOLGN ( XV , YV , 4 ) 

CALL JSIZE( .4, .4) 

CALL JFONT( 3 ) 

CALL J JUST (2, 2) 

CALL JMOVE(5. ,9.2) 

CALL JHSTRG( ’MATERIALS' ) 

CALL JMOVE{ .1 , .8) 

CALL JHSXTN ( YEAR , DX , DY ) 

CALL JPIDEX(6 , 0 ) 

CALL JRRECT ( DX , DY ) 


B - 24 



ooooooo o o no no 


CALL JJUST( 1,1) 

CALL JHSTRG( YEAR) 

CALL JMOVE (9.9, . 8 ) 

CALL JSIZE( .25, .25) 

CALL JFONT ( 1 ) 

CALL JJUST (3,1 ) 

CALL JHSTRG( 'PREPARED BY CSC') 

C 

C CLOSE THE TEMPORARY SEGMENT. 

CALL JCLOSE 



C COMPUTE THE FACTOR FOR CONVERTING DEGREES TO RADIANS. 
DTORAD=ATAN( 1 .0)/45. 


TOTAL THE REGIONAL DATA. 
TOTAL^O.O 
DO 3000 1=1 ,8 

3000 TOTAL = TOTAL+REGION ( I ) 


OPEN A TEMPORARY SEGMENT FOR THE PIE CHART SECTORS AND LABELS. 
CALL JOPEN 
START=0. 

CALL JSIZE( .2, .2) 

CALL JFONT ( 1 ) 

DO 5000 1 = 1 ,8 
A0=START 

A1 =REGION ( I ) /TOTAL *3 60. +S TART 
START=A1 

CALL JPIDEX( I , 1+30 ) 

CALL JS ECTR ( 5 . , 5 • , 0 . , RAD 1 , 0 , AO , A1 ) 

AMID=(A1 -AO) /2.+A0 
ARAD=AMID*DTORAD 
Cl =COS ( ARAD ) 

SI =S IN (ARAD) 

CALL JMOVE(5.+RAD2*C1 ,5.+RAD2*S1 ) 

CALL JDRAW(5.+RAD3*C1 ,5.+RAD3*S1 ) 

IF ( AMID.LT.45. .OR. AMID .GE. 315.) CALL JJUST(1,2) 

IF (AMID ,GT. 45. .AND. AMID .LT. 135.) CALL JJUST(2,1) 
IF (AMID .GE. 135. .AND. AMID .LT. 225.) CALL JJUST(3,2) 
IF (AMID .GE. 225. .AND. AMID .LT. 315.) CALL JJUST(2,3) 

CALL JMOVE(5.+RAD4*C1 ,5.+RAD4*S1 ) 

000 CALL JHSTRG ( LABEL ( I ) ) 


CLOSE THE TEMPORARY SEGMENT. 
CALL JCLOSE 


PAUSE TO VIEW CHART. 
CALL JPAUSE(IDEV) 


TERMINATE DI-3000; ALL DEVICES ARE DESELECTED AND TERMINATED. 
CALL JEND 


B - 25 



Figure CDP2. Exploded pie chart. 
PRECEDING PAGE BLANK NOT FILMED 


B - 27 




o o 


PROGRAM CDP2 


C 

C EXPLODED PIE CHART 

C 

C INITIALIZE DATA 

REAL OFFSET, RADI , RAD2 , RAD3 , RAD4 
REAL XV ( 4 ) , YV ( 4 ) , ZV ( 4 ) , REGION ( 8 ) 

CHARACTER* 14 LABEL ( 8 ) 

CHARACTER*4 YEAR 
C 

DATA OFFSET, RADI , RAD2 , RAD3 , RAD4 / . 25 , 2 . , 2 . 35 , 2 .85, 2 .95/ 

DATA REGION ( 1 ) , REGION ( 2 ) , REGION ( 3 ) , REGION ( 4 ) /2 1 . , 6 . , 24 . , 28 . / 

DATA REGION ( 5 ) ,REGION(6) ,REGION(7) ,REGION(8)/4. ,1 3. ,1 8. ,32./ 

C 

DATA YEAR /'I 988’/ 

C 

DATA LABEL ( 1 ) / 1 N [ BLC ] ICKEL ' / 

DATA LABEL ( 2 ) / 1 M ( BLC 1 AGNES ICJM* / 

DATA LABEL ( 3 ) / 1 A [BLC] LUMINUM ' / 

DATA LABEL ( 4 ) / 1 G [ BLC ] OLD 1 / * 

DATA LABEL ( 5 ) / ' I [ BLC ] RON 1 / 

DATA LABEL ( 6 ) / 1 S [ BLC ] ILVER ' / 

DATA LABEL ( 7 ) / 1 C [ BLC ] OPPER 1 / 

DATA LABEL ( 8 ) / ' L [ BLC ] EAD ' / 



C INITIALIZE DI-3000 
CALL CBEGIN 
CALL JBEGIN 

C 

C WRITE TO A DEVICE IDEV 
IDEV=0 

CALL JDINIT(IDEV) 

CALL JDEVON(IDEV) 


DEFINE THE VIEWSPACE AND WINDOW OF SAME ASPECT RATIO 
CALL JVSPAC(-1 . , 1 . ,-t . , 1 . ) 

CALL JWINDO (0.,10.,0.,10.) 

C 

C FILL POLYGONS BY DEFAULT 
CALL JDPINT(I) 

C 

C OPEN A TEMPORARY SEGMENT FOR BORDERS. 

CALL JOPEN 

CALL JIWIND( XV , YV , ZV ) 

CALL JPIDEX( 4,0) 

CALL JPOLGN ( XV , YV , 4 ) 

CALL JSIZE( .5, .5) 

CALL JFONT( 3 ) 

CALL JJUST( 2,2) 

CALL JMOVE(5. ,9.2) 

CALL JHSTRG( 'MATERIALS' ) 

CALL JMOVE( .1 , .8) 

CALL JHSXTN ( YEAR , DX , DY ) 

CALL JPIDEX (6,0) 


B - 28 



CALL JRRECT(DX,DY) 

CALL JJUST(1 , 1 ) 

CALL JHSTRG ( YEAR ) 

CALL JMOVE (9.9, . 8 ) 

CALL JSIZE( .25, .25) 

CALL JFONT(1 ) 

CALL JJUST( 3 , 1 ) 

CALL JHSTRG ( 'PREPARED BY CSC') 

C 

C CLOSE TEMPORARY SEGMENT 
CALL JCLOSE 

C 

C COMPUTE THE FACTOR FOR CONVERTING DEGREES TO RADIANS. 
DTORAD=ATAN( 1 .0) /45. 

C 

C TOTAL THE REGIONAL DATA. 

TOTAL=0 .0 
DO 3000 1=1 ,8 

3000 TOTAL = TOTAL+REGION( I ) 



C OPEN A TEMPORARY SEGMENT FOR THE PIE CHART SECTORS AND LABELS. 
CALL JOPEN 
START* 5 . 

CALL JSIZE( .15, .15) 

CALL JF0NT(1 ) 

DO 5000 1=1 ,8 
A0=START 

A1 =REGION ( I ) /TOTAL*360.+START 
START=A1 

AMID=(A1-A0)/2. +A0 
ARAD= AMI D * DTORAD 
Cl =COS ( ARAD ) 

SI =SIN( ARAD ) 

CALL JPIDEX( I , 1+30 ) 

C 

XO=OFFSET*C1 +5 . 

YO=OFFSET*S1 +5. 

C 

CALL JSECTR(X0,Y0,0. ,RAD1 ,0,A0,A1 ) 

C 

CALL JMOVE( RAD2*C1 +5. ,RAD2*S1 +5. ) 

C 

IF (AMID. LT. 45. .OR. AMID .GE. 315.) CALL JJUST(1,2) 

IF (AMID .GT. 45. .AND. AMID .LT. 135.) CALL JJUST(2,1) 
IF (AMID .GE. 135. .AND. AMID .LT. 225.) CALL JJUST(3,2) 
IF (AMID .GE. 225. .AND. AMID .LT. 315.) CALL JJUST(2,3) 
C 

CALL JMOVE (RAD4*C1 +5. ,RAD4*S1 +5. ) 

5000 CALL JHSTRG(LABEL(I) ) 



C CLOSE TE TEMPORARY SEGMENT. 

CALL JCLOSE 
C 




B - 29 


o o 


C PAUSE TO VIEW CHART. 

CALL JPAUSE(IDEV) 


TERMINATE Dl-3000; ALL DEVICES ARE DESELECTED AND TERMINATED. 
CALL JEND 
STOP 
END 


B - 30 





Figure CDP3. Basic pie chart with a legend. 


B - 31 



oooo oo on no 


PROGRAM CDP3 




C BASIC PIE CHART WITH A LEGEND 

C 

C INITIALIZE DATA 

REAL OFFSET, RADI ,RAD2,RAD3 ,RAD4 
REAL BPOS (4) 

REAL XV( 4) , YV( 4) , ZV ( 4) , REGION ( 8 ) 

CHARACTER* 14 LABEL ( 8 ) 

CHARACTER *4 YEAR 
C 

CHARACTER KEYCHR( 1 ,8) *1 5 
INTEGER ISTORE (15,8) 

DATA OFFSET, RADI , RAD2 , RAD3 , RAD4 / . 5 , 4 . , 4 . 7 , 5 .7 , 5 .9/ 

DATA REGION ( 1 ) , REGION ( 2 ) , REGION ( 3 ) , REGION ( 4) /2 . 1 , .6,2.4, 2.8/ 
DATA REGION(5) ,REGION(6) ,REGION(7) , REG ION(8)/ .4,1 .3,1 .8,3.2/ 
C 

DATA YEAR / ' 1 988 ' / 

C 

DATA LABEL(1 ) / ' N [ BLC ] ICKEL ' / 

DATA LABEL ( 2 ) / ' M[BLC) AGNES IUM' / 

DATA LABEL ( 3 ) / ' A ( BLC } LUMI NUM ' / 

DATA LABEL ( 4 ) / ' I [ BLC ) RON 1 / 

DATA LABEL ( 5 ) / 1 T [ BLC ] IN 1 / 

DATA LABEL ( 6 ) / 1 C [ BLC ] OPPER ' / 

DATA LABEL ( 7 ) / ‘ G ( BLC ] OLD 1 / 

DATA LABEL ( 8 ) / ' Z [ BLC ] INC 1 / 




* 


INITIALIZE DI-3000 
CALL JBEGIN 
CALL CBEGIN 


WRITE TO THE DEVICE IDEV 
IDEV=0 

CALL JDINIT(IDEV) 
CALL JDEVON ( IDEV ) 


DEFINE THE VIEWSPACE AND WINDOW OF SAME ASPECT RATIO 
CALL JVSPAC(-1 . ,1 . ,-1 . ,1 . ) 

CALL JWINDO(0. ,10.,0.,10.) 


FILL POLYGONS BY DEFAULT. 
CALL JDPINT( 1 ) 


OPEN A TEMPORARY SEGMENT FOR BORDERS. 
CALL JOPEN 

CALL JIWIND ( XV , YV , ZV ) 

CALL JPIDEX( 4,0) 

CALL JPOLGN ( XV , YV , 4 ) 

CALL JSI ZE ( .6, .6) 

CALL JFONT( 5 ) 

CALL JJUST( 2,2) 

CALL JMOVE ( 5 . ,9.1 ) 

CALL JHSTRG( 1 CGL PIE GRAPH' ) 


B - 32 



on o oo oooo oooo 


CALL JMOVE( .1 , .5) 

CALL JHSXTN ( YEAR , DX , DY ) 

CALL JPIDEX(6,0) 

CALL JRRECT(DX,DY) 

CALL J JUST (1,1) 

CALL JHSTRG (YEAR) 

CALL JMOVE(9.9, .5) 

CALL JSIZE( .25, .25) 

CALL JFONT ( 1 ) 

CALL JJUST(3,1) 

CALL JHSTRG ( 'PREPARED BY CSC') 


CLOSE THE TEMPORARY SEGMENT. 
CALL JCLOSE 


DESIGN THE PIE TO BE 50% SMALLER 
RADI =RAD1 - ( RADI * . 50 ) 
RAD2=RAD2-(RAD2*.50) 
RAD3=RAD3-(RAD3*.50) 

RAD 4 =R AD 4- ( RAD 4* . 50 ) 


COMPUTE THE FACTOR FOR CONVERTING DEGREES TO RADIANS. 
DTORAD=ATAN ( 1 . 0 ) /45 . 


TOTAL THE REGIONAL DATA. 
TOTAL=0 . 0 
DO 3000 1=1 ,8 

3000 TOTAL = TOTAL+REGION ( I 


) 


OPEN A TEMPORARY SEGMENT FOR THE PIE CHART SECTORS AND LABELS. 
CALL JOPEN 

CALL CKEYIN( ISTORE.KEYCHR, 8 , 1 ,1 ) 

START=5 • 

CALL JSIZE( .3, .3) 

CALL JFONT (1 ) 

DO 5000 1=1 ,8 
A0=START 

A1 =REGION ( I ) /TOTAL* 3 60 .+S TART 
CALL JPIDEX(I f 1+30) 

CALL JSECTR(3. ,5. ,3. ,RAD1 ,0,A0,A1 ) 

START=A1 

AMID=(A1-A0)/2.+A0 
ARAD=AMID*DTORAD 
Cl =COS (ARAD) 

SI =SIN(ARAD ) 

000 CALL CKEYLB(ISTORE,KEYCHR,-4,LABEL(I) ) 

BPOS ( 1 )=9.5 
BPOS ( 2 ) =8 . 

CALL CKEYPL( ISTORE,KEYCHR, ' ',' ' , BPOS , 5 , 1 ,0) 


CLOSE THE TEMPORARY SEGMENT. 
CALL JCLOSE 


C 


B - 33 



o o 


C PAUSE FOR OPERATOR ACTION. 
CALL JPAUSE(IDEV) 


TERMINATE DI-3000; ALL DEVICES ARE DESELECTED AND TERMINATED. 
CALL JEND 
STOP 
END 


♦ 


* 


B - 34 




Figure CDR1. 







Simple program to demonstrate symbols and 
polygon fill patterns. 


B - 35 




<"> n °9 oooooo on o o 


PROGRAM CDR1 


C 

C SIMPLE PROGRAM TO DEMONSTRATE SYMBOLS AND POLYGON FILL PATTERNS 

C 

C INITIALIZE DI-3000 
CALL JBEGIN 


THIS MUST BE THE FIRST CGL CALL TO INITIALIZE THE CGL 
CALL CBEGIN 


WRITE TO THE IDEV DEVICE 
IDEV=0 

CALL JDINIT(IDEV) 

CALL JDEVON(IDEV) 


SET UP THE VIEWING WINDOW 

CALL JWINDO(0. ,11 . ,0. ,11 . ) 


OPEN CURRENT SEGMENT 
CALL JOPEN 


SET THE CURRENT POLYGON AND SET THE CURRENT SIZE OF SYMBOLS 
CALL JPINTR( 1 ) 

CALL CSYMSZ ( . 5 ) 


A LOOP WHICH PRINTS NASA POINT SYMBOLS WITHIN CURRENT SEGMENT 
DO 1 1=1,10 

CALL JPIDEX(1 ,48-1) 

CALL CSYMNO(I) 

CALL CPNTPT(REAL(I) ,1 . ) 


ENDS ALL GRAPGICS AND CLOSES CURRENT SEGMENT 
CALL JPAUSE(IDEV) 

CALL JCLOSE 
CALL JFRAME 
CALL JDEVOF(IDEV) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


B - 36 



Figure CDR2. 


Simple program to demonstrate symbols and 
ploygon symbol sizes. 



no on on no on 


PROGRAM CDR2 


c 

C SIMPLE PROGRAM TO DEMONSTRATE SYMBOLS AND POLYGON SYMBOL SIZES 

C 

C INITIALIZE DI- 3000 AND SET UP CURRENT IDEV DEVICE 
IDEV=0 
CALL JBEGIN 
CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 


INITIALIZE CGL ATTRIBUTES TO DEFAULTS AND SET CURRENT WINDOW 
CALL C BEGIN 

CALL JWINDO(0. ,11 . ,0. , 1 1 . ) 


OPEN CURRENT SEGMENT 
CALL JOPEN 


OUTPUT SYMBOL (WITH DEFAULT SYMBOL NUMBER AND SYMBOL SIZE) 
CALL CPNTPT( 1 . ,1 . ) 


CHANGE SYMBOL NUMBER TO 3, SYMBOL SIZE TO .5, AND DISPLAY 
CALL CSYMNO( 3 ) 

CALL CSYMSZ ( .5) 

CALL CPNTPT( 2. , 1 . ) 


RESET CGL ATTRIBUTES BACK TO DEFAULTS 
CALL C BEGIN 
CALL CPNTPT( 3 . , 1 . ) 

C 

C END ALL GRAPHICS AND CLOSE CURRENT SEGEMENT 
CALL JPAUSE(IDEV) 

CALL JCLOSE 
CALL J FRAME 
CALL JDEVOF(IDEV) 

CALL JDEND ( IDEV ) 

CALL JEND 

STOP 

END 


B - 38 





no no no no on no on oo oo oo oo 


PROGRAM CDR3 


C 

C SIMPLE PROGRAM TO DEMONSTRATE HOW TO GENERATE A SET OF AXES 

C 

C INITIALIZE CGL AND DI-3000 
CALL CBEGIN 
CALL JBEGIN 


WRITE TO THE IDEV DEVICE 
IDEV=0 

CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 


SET UP WINDOW AND VIEWSPACE 
CALL CVSPAC(9. ,9. ) 

CALL JWINDO(0. ,9. ,0. ,9. ) 


OPEN CURRENT SEGMENT 
CALL JOPEN 


SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 
CALL JSIZE( .2, .2*1 .25) 


POSITION STRING, AND SET JUSTIFICATION (CENTER, CENTER) 
CALL JMOVE (4.5,8.75) 

CALL JJUST( 2,2) 


OUTPUT THE STRING 

CALL JHSTRGCA T[BLC]ITLE') 


RESET THE CHARACTER SIZE FOR THE AXES 
CALL JSIZE( .1 , .1 *1 .25) 


POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
CALL JMOVE ( 2 . , 2 . ) 


DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB( 'H(BLC]ORIZONTAL [BUC1 A[BLC] XIS ' , 1 ) 
CALL CHAXIS (5.,10.,1.,4.) 


DESCRIBE THE VERTICAL AXIS 

CALL CVLAB ( ' V ( BLC ] ERTICAL [BUC] A[BLC] XIS' , 1 ) 
CALL CVPREC ( 3 ) 

CALL CVAXIS( .0, .01 , .001 ,3.5) 


END ALL GRAPHICS AND CLOSE CURRENT SEGMENT 
CALL JPAUSE(IDEV) 

CALL JCLOSE 
CALL JFRAME 
CALL JDEVOF(IDEV) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


B - 40 




Figure CDR4. 


Basic I! 


B 


no on 


PROGRAM CDR4 




C BASIC LINE CHART 

C 

C ALLOCATE AND INITIALIZE DATA 

PARAMETER ( MAXPTS=1 0, MAXSET=1 ) 

REAL X ( MAXPTS ) , Y ( MAXPTS , MAXS ET ) 

DATA X/5. 5, 6. 0,6. 5, 7. 0,7. 5, 8. 0,8. 5, 9. 0,9. 5, 10./ 

DATA ( Y(KI , 1 ),KI=1 ,10) 

+ /.001 , .003, .0075, .004, .006, .008, .009, .005, .003, .002/ 


WRITE TO THE DEVICE IDEV 
IDEV=0 
CALL CBEGIN 
CALL JBEGIN 
CALL JD IN IT (IDEV) 
CALL JDEVON ( IDEV ) 


ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC( 9 . , 9 . ) 

CALL JWINDO (0.,9.,0.,9.) 

CALL JOPEN 

C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 

CALL JSIZE( .2, .2*1 .25) 

C POSITION STRING, AND SET JUSTIFICATION (CENTER, CENTER) 

CALL JMOVE ( 4 . 5 , 6 . 0 ) 

CALL J JUST (2, 2) 

C OUTPUT THE STRING 

CALL JHSTRG( 'A T(BLC] ITLE' ) 

C RESET THE CHARACTER SIZE FOR THE AXES 
CALL JSIZE( .1 , .1*1 .25) 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
CALL JMOVE(2. ,2.) 

C DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB( 'H[BLC]ORIZONTAL tBUC] A[BLC] XIS ' , 1 ) 

CALL CHAXIS(5. ,10. ,1 . ,4.) 

C DESCRIBE THE VERTICAL AXIS 

CALL CVLAB( 'V[BLC)ERTICAL [BUClAlBLClXIS 1 , 1 ) 

CALL CVPREC ( 3 ) 

CALL CVAXIS( .0, .01 , .001 ,3.5) 

C SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV ( 2 . , 2 . ,0 . ,VX1 ,VY1 ) 

CALL JCONWV ( 2. +4. ,2. +3. 5,0. ,VX2,VY2) 

C CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES) 

CALL JCLOSE 



C SET WINDOW TO MATCH DATA COORDINATES, AND PLOT WITHIN BOUNDARIES 
C OF THE AXES (BY SAVED VIRTUAL COORDINATES) 

CALL JWINDO(5. ,10., .0, .01 ) 

CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 

C PLOT FIRST DATA CURVE 
CALL CSYMNO(I) 

CALL CLNPAT(I) 


B - 42 



o o 


CALL CLNPLT( X, Y( 1 » 1 ) , MAXPTS > 
CALL JCLOSE 


TERMINATE GRAPHICS 

CALL JPAUSE(IDEV) 

CALL JFRAME 

CALL JDEVOF ( IDEV ) 

CALL JD END (IDEV) 

CALL JEND 

STOP 

END 





on on 


PROGRAM CDR5 




C COMPLETE LINE CHART 

C 

C ALLOCATE AND INITIALIZE DATA 

PARAMETER (MAXPTS=1 0,MAXSET=2) 

REAL X ( MAXPTS ) , Y ( MAXPTS , MAXS ET ) 

DATA X/5. 5, 6. 0,6. 5, 7. 0,7. 5, 8. 0,8. 5, 9. 0,9. 5, 10./ 

DATA (Y(KI,1 ) ,KI=1 ,10) 

+ /.001 , .003, .0075, .004, .006, .008, .009, .005, .003, .002/ 

DATA ( Y( KI , 2 ) ,KI=1 ,10) 

+ /.001 5, .004, .007, ,0045, .0065, .0078, .0085, .0055, .0032, .002/ 


WRITE TO THE DEVICE IDEV 
IDEV=0 
CALL CBEGIN 
CALL JBEGIN 
CALL JDINIT(IDEV) 
CALL JDEVON ( IDEV ) 


ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC(9. ,9. ) 

CALL JWINDO(0. ,9. ,0. ,9. ) 

CALL JOPEN 

C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 

CALL JSIZE( .2, .2*1 .25) 

C POSITION TEXT, AND SET TEXT JUSTIFICATION (CENTER, CENTER) 
CALL JMOVE(4.5,6.0) 

CALL J JUST (2, 2) 

C OUTPUT THE STRING 

CALL JHSTRGCA T(BLCllTLE') 

C RESET THE CHARACTER SIZE FOR THE AXES 
CALL JSIZE( .1 , .1*1 .25) 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
XORG=2 . 

YORG* 2 . 

CALL JMOVE ( XORG , YORG ) 

C DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB( 'HtBLClORIZONTAL (BUC]A(BLC)XIS' , 1 ) 

C XLEN - REPRESENTS THE X-AXIS LENGTH 
XLEN=4 . 0 

CALL CHAXIS( 5 . , 1 0 . , 1 . , XLEN ) 

C DESCRIBE THE VERTICAL AXIS 

CALL CVLAB ( ' V ( BLC ] ERTICAL [BUC]A[BLC]XIS' , 1 ) 

CALL CVPREC ( 3 ) 

C YLEN - REPRESENTS THE Y-AXIS LENGTH 
YLEN* 3. 5 

CALL CVAXIS( .0, .01 , .001 ,YLEN) 

C SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV( XORG, YORG, 0. ,VX1 ,VY1 ) 

CALL JCONWV ( XORG+XLEN , YORG+ YLEN , 0 . ,VX2,VY2) 

C CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES) 

CALL JCLOSE 

C 


B - 45 


o o 


C SET WINDOW TO MATCH DATA COORDINATES, AND PLOT WITHIN BOUNDARIES 
C OF THE AXES (BY SAVED VIRTUAL COORDINATES) 

CALL JWINDO(5.,10.,.0, .01) 

C 5,10 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE X-DIRECTION 
C 0,.01 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE Y-DIRECTION 
CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 

C PLOT FIRST DATA CURVE 
CALL CSYMNO( 1 ) 

CALL CLNPAT(1 ) 

CALL CLNPLT(X,Y( 1,1) ,MAXPTS) 

C SET SYMBOL NUMBER TO 2, AND PLOT SECOND DATA CURVE 
CALL CSYMNO( 2 ) 

CALL CLNPAT( 2) 

CALL CLNPLT ( X , Y ( 1 , 2 ) , MAXPTS ) 

CALL JCLOSE 


TERMINATE GRAPHICS 

CALL JPAUSE(IDEV) 

CALL JFRAME 

CALL JDEVOF(IDEV) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


B - 46 



A Title 



6 7 8 9 10 

Horizontal Axi« 


Figure CDR6. Complete line chart with a legend. 



o o o o 


PROGRAM CDR6 




C COMPLETE LINE CHART WITH A LEGEND 



C ALLOCATE AND INITIALIZE DATA 

PARAMETER ( MAXPTS=1 0 , MAXSET=2 ) 

REAL X ( MAXPTS ) , Y ( MAXPTS , MAXS ET ) , BPOS ( 4 ) 

PARAMETER ( NLINS=2 ,NCOLS=1 ,NTLINS=1 ) 

CHARACTER KEYCHR(NCOLS ,NLINS) *20 
INTEGER ISTORE( 1 5,NLINS) , JCOL(NCOLS) 

DATA X/5. 5, 6. 0,6. 5, 7. 0,7. 5, 8. 0,8. 5, 9. 0,9. 5, 10./ 

DATA JCOL/1 / 

DATA ( Y(KI , 1 ),KI=1 ,10) 

+ /.001 , .003, .0075, .004, .006, .008, .009, .005, .003, .002/ 

DATA ( Y(KI , 2 ) ,KI=1 ,10) 

+ /.001 5 , .004, .007, .0045, .0065, .0078, .0085, .0055, .0032, .002/ 


WRITE TO THE DEVICE IDEV 
IDEV=0 
CALL CBEGIN 
CALL JBEGIN 
CALL JDINIT(IDEV) 
CALL JDEVON ( IDEV ) 


ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC(9. ,9. ) 

CALL JWINDO (0.,9.,0.,9.) 

CALL JOPEN 

C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 

CALL JSIZE( .2, .2*1 .25) 

C POSITION TEXT, AND SET TEXT JUSTIFICATION (CENTER, CENTER) 
CALL JMOVE( 4 .5,6.0) 

CALL JJUST( 2 , 2 ) 

C OUTPUT THE STRING 

CALL JHSTRG('A TlBLC] ITLE' ) 

C RESET THE CHARACTER SIZE FOR THE AXES 
CALL JSIZE( .1 , .1*1 .25) 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
XORG=2 . 

YORG=2 . 

CALL JMOVE ( XORG , YORG ) 

C DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB( 'H(BLC]ORIZONTAL (BUC] A[BLC)XIS‘ , 1 ) 

C XLEN - REPRSENTS THE X-AXIS LENGTH 
XLEN-4 . 0 

CALL CHAXIS ( 5 . , 1 0. , 1 . ,XLEN ) 

C DESCRIBE THE VERTICAL AXIS 

CALL CVLAB ( ' V [ BLC ] ERTICAL [BUC] A(BLC]XIS‘ , 1 ) 

CALL CVPREC( 3) 

C YLEN - REPRESENTS THE Y-AXIS LENGTH 
YLEN=3 .5 

CALL CVAXIS( .0, .01 , .001 ,YLEN) 

C SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV (XORG, YORG, 0. ,VX1 ,VY1 ) 


B - 48 


o o 


CALL JCONWV ( XORG+XLEN , YORG+YLEN, 0 . ,VX2,VY2) 

C CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES) 

CALL JCLOSE 

C 

C SET WINDOW TO MATCH DATA COORDINATES, AND PLOT WITHIN BOUNDARIES 
C OF THE AXES (BY SAVED VIRTUAL COORDINATES) 

CALL JWINDOt 5. ,10.,.0,.0l) 

C 5,10 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE X-DIRECTION 
C 0,.01 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE Y-DIRECTION 
CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 

CALL CKEYINt ISTORE, KEYCHR, NLINS ,NCOLS ,NTLINS) 

C PLOT FIRST DATA CURVE 
CALL CSYMNO( 1 ) 

CALL CLNPAT( 1 ) 

CALL CKE YLB ( I STORE , KE YCHR , 3 , * D [ BLC ] ATA SET 1') 

CALL CLNPLT (X,Y(1 ,1 ), MAXPTS ) 

C SET SYMBOL NUMBER TO 2, AND PLOT SECOND DATA CURVE 
CALL CSYMNO( 2) 

CALL CLNPAT( 2 ) 

CALL CKEYLB( ISTORE, KEYCHR, 3, ' D[BLC] ATA SET 2') 

CALL CLNPLT(X,Y(1 ,2), MAXPTS) 

CALL JCLOSE 



C NOW OUTPUT LEGEND 

C SET WINDOW AND VIEWPORT FOR PAGE COORDINATES 
CALL JVPORT (-1.,1.,-1.,1.) 

CALL JWINDOtO. ,9. ,0. ,9. ) 

BPOS ( 1 )=9. 

BPOS( 2)=2.+3 .5 
CALL JOPEN 

CALL JSIZE( .1 , .1*1 .25) 

CALL CKEYPL( ISTORE, KEYCHR, *K[BLC]EY TITLE* C[BLC]OLUMN TITLE', 

+ BPOS , 5 , JCOL , 1 ) 

CALL JCLOSE 


TERMINATE GRAPHICS 

CALL JPAUSE(IDEV) 

CALL JFRAME 

CALL JDEVOF ( IDEV ) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


B - 49 



oo ooooo non o non on on 


PROGRAM CDR7 




C SEMI-LOGARITHMIC LINE CHART (SINGLE DATA SET) 

C 

C SET UP DATA 

PARAMETER ( NPTS=6 ) 

REAL X ( NPTS ) , Y ( NPTS ) , YTEMP ( NPTS ) 

DATA X/2. 2, 3. 0,4. 3, 5.1 ,5. 5, 6. 7/ 

DATA Y/3.,50. ,100. ,500. ,750. ,985./ 

DATA XORG/2 .5/ , YORG/2 . /, XLEN/7 ./, YLEN/7 . /, XPAGE/1 1 ,/,YPAGE/1 1 ./ 


SET UP GRAPHICS AREA 
IDEV=0 
CALL JBEGIN 
CALL CBEGIN 
CALL JDINIT(IDEV) 
CALL JDEVON(IDEV) 


SET PAGE COORDINATES, AND OPEN A TEMPORARY SEGMENT 
CALL JWINDO(0. ,XPAGE,0. ,YPAGE) 

CALL JOPEN 


SET CHARACTER SIZE, AND OUTPUT TITLE 

SET THE CHARACTER SIZE (IN TERMS OF PAGE CORRDINATES ) 
XSIZE=.25 

CALL JSIZE( XSIZE, XSIZE*1 .25) 

POSITION STRING, AND SET JUSTIFICATION (CENTER, BOTTOM) 
CALL JMOVE( XPAGE/2 . ,0.+XSIZE) 

CALL J JUST (2, 1 ) 

OUTPUT THE STRING 

CALL JHSTRG ( 1 P [ BLC ] OWER LEVEL VS. FREQUENCY') 


RESET THE CHARACTER SIZE FOR THE AXES 
XSIZE=.2 

CALL JSIZE(XSIZE,XSIZE*1 .25) 

POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
CALL JMOVE ( XORG , YORG ) 


HORIZONTAL AXIS (LINEAR) 

CALL CMNMX ( X , NPTS , XMIN , XMAX ) 

DETERMINE PUBLICATION QUALITY SCALE FACTORS 

CALL CSCALE ( XMIN , XMAX , AMIN , AMAX , NMAJOR , NMINOR , X INCR , NLEFT , NRIGHT ) 
SET HORIZONTAL AXIS ATTRIBUTES 
CALL CHMTIC( NMINOR) 

CALL CHPREC( NRIGHT) 

CALL CHLAB( ' F [ BLC] REQUENCY, [ BUC ] H [ BLC ] Z ' , 1 ) 

CALL CHAXIS( AMIN, AMAX, XINCR,XLEN) 


VERTICAL AXIS (LOGARITHMIC) 

CALL CMNMX (Y, NPTS, YMIN,YMAX) 

CALL CEXP ( YMIN , YMAX, MINEXP , MAXEXP ) 
CALL CVLAB( 'P[BLC)OWER LEVEL ',1) 
CALL CSET( 1 NVLOGF ' , 1 ) 

CALL CSET( ' NVLOGS 1 , MINEXP) 


B - 51 


on o oo oooo on 


NTIC= ( MAXEXP-MINEXP ) +1 
CALL CVLOG ( YLEN , NTIC , 4 ) 


SAVE DATA REGION VIRTUAL COORDINATES 
CALL" 1 JCONWV ( XORG , YORG , 0 . ,VX1 f VY1 ) 

CALL JCONWV ( XORG+XLEN , YORG+YLEN , 0 . ,VX2,VY2) 
CALL JCLOSE 


SET VIEWPORT TO DATA REGION VIRTUAL COORDINATES 
CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 


SET UP DATA REGION WINDOW 
DO 1 KI=1 , NPTS 
YTEMP(KI)=LOG10(Y(KI) ) 

X-AXIS IS LOG, MIN AND MAX MUST BE SCALED. 

CALL JWINDO ( AMIN, AMAX, REAL ( MINEXP ), REAL (MAXEXP) ) 
ENABLE CLIPPING TO EXCLUDE EXTRANEOUS DATA 
CALL JWCLIP( .TRUE. ) 

CALL JOPEN 
PLOT DATA 

CALL CSYMNO(I) 

CALL CLNPAT(I) 

CALL CLNPLT( X, YTEMP,NPTS ) 

CALL JPAUSE ( IDEV ) 

CALL JCLOSE 
CALL JFRAME 


TERMINATE GRAPHICS 

CALL JDEVOF(IDEV) 
CALL JD END (IDEV) 
CALL JEND 


STOP 

END 




on n non non o non oo on 


PROGRAM CDR8 


C 

C LOG-LOG LINE CHART (MULTIPLE DATA SETS) 

C 

C SET UP DAI'A 

PARAMETER ( MAX PTS =6, MAXSET=2 ) 

REAL X(MAXPTS) , Y ( MAXPTS , MAXSET ) , YTEMP ( MAXPTS ) ,XTEMP(MAXPTS ) 
DATA X/22.,30.,43, ,51, ,85, ,97,/ 

DATA ( Y (KI , 1 ) ,KI=1 , MAXPTS )/3.0,50. , 1 0 • ,50, ,75, ,98, / 

DATA (Y(KI,2) ,KI=1 , MAXPTS) /7 .0,90. , 1 0. ,25, ,55, ,90, / 

DATA XORG/2 . / , YORG/2 . /, XLEN/7 ./ , YLEN/7 ,/, XP AGE/1 1 ./,YPAGE/1 1 ./ 


SET UP GRAPHICS AREA 
IDEV=0 
CALL JBEGIN 
CALL CBEGIN 
CALL JDINIT(IDEV) 
CALL JDEVON ( IDEV ) 


SET PAGE COORDINATES, AND OPEN A TEMPORARY SEGMENT 
CALL JWINDO(0 . , XPAGE,0 . , YPAGE) 

CALL JOPEN 


SET CHARACTER SIZE, AND OUTPUT TITLE 

SET THE CHARACTER SIZE (IN TERMS OF PAGE CORRDINATES) 
XSIZE=.25 

CALL JSIZE( XSIZE, XSIZE*1 .25) 

POSITION STRING, AND SET JUSTIFICATION (CENTER, BOTTOM) 
CALL JMOVE( XPAGE/2 . , O.+XSIZE) 

CALL J JUST (2,1 ) 

OUTPUT THE STRING 

CALL JHSTRGCA T[BLC]ITLE’) 


RESET THE CHARACTER SIZE FOR THE AXES 
XSIZE=.2 

CALL JSIZE( XSIZE, XSIZE* 1 .25) 

POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
CALL JMOVE ( XORG , Y ORG ) 


HORIZONTAL AXIS (LOG) 

CALL CMNMX(X, MAXPTS, XMIN,XMAX) 

CALL CEXP( XMIN, XMAX, MXEXP1 , MXEXP2) 

SET HORIZONTAL AXIS ATTRIBUTES 

CALL CHLAB( ’ H[BLC]ORIZONTAL [BUC]A[BLC]XIS ' , 1 ) 
CALL CSET( 1 NHLOGF 1 ,1 ) 

CALL CSET( 1 NHLOGS' ,MXEXP1 ) 

NTICX= ( MXEXP2-MXEXP 1 )+1 
CALL CHLOG ( XLEN , NTICX , 1 ) 


VERTICAL AXIS (LOGARITHMIC) 

CALL CMNMX ( Y ( 1 ,1 ), MAXPTS , YMIN , YMAX) 

DO 10 1=2, MAXSET 

CALL CMNMX ( Y ( 1 , I ) , MAXPTS , TMIN , TMAX ) 
IF ( TMIN . LT . YMIN ) YMIN=TMIN 


B - 54 



°9 _ O oooooo oo 


10 IF(TMAX.GT.YMAX) YMAX=TMAX 

CALL CEXP( YMIN , YMAX, MYEXP1 , MYEXP2 ) 

CALL CVLAB( 'V[BLC]ERTICAL [BUC] A{BLC] XIS ' , 1 ) 
CALL CSET( ' NVLOGF ' , 1 ) 

CALL CSET( ' NVLOGS 1 ,MYEXP1 ) 

NTICY= ( MYEXP2-MYEXP 1 )+1 
CALL CVLOG ( YLEN , NTICY , 1 ) 


SAVE DATA REGION VIRTUAL COORDINATES 
CALL JCONWV ( XORG, YORG, 0 . , VX1 , VY1 ) 

CALL JCONWV ( XORG+XLEN , YORG+ YLEN, 0. ,VX2,VY2) 
CALL JCLOSE 


SET VIEWPORT TO DATA REGION VIRTUAL COORDINATES 
CALL JVPORT ( VX1 , VX2 , VY1 , VY2 ) 


SET UP DATA REGION WINDOW 

X-AXIS IS LOG, MIN AND MAX MUST BE SCALED. 

CALL JWINDO(REAL(MXEXP1 ) , REAL(MXEXP2) , REAL(MYEXP1 ) , REAL( MYEXP2 ) ) 
ENABLE CLIPPING TO EXCLUDE EXTRANEOUS DATA 
CALL JWCLIP( .TRUE. ) 

CALL JOPEN 
PLOT DATA 

DO 1 KI=1 , MAXPTS 
XTEMP (KI )=LOG1 0( X( KI ) ) 

DO 2 KI 1 =1 , MAXSET 
CALL CSYMNO(KII) 

CALL CLNPAT(KII) 

DO 3 KI2=1, MAXPTS 

YTEMP ( KI2 ) =LOG1 0(Y(KI2,KI1 ) ) 

CALL CLNPLT( XTEMP, YTEMP, MAXPTS) 

CALL JPAUSE(IDEV) 

CALL JCLOSE 
CALL JFRAME 


TERMINATE GRAPHICS 

CALL JDEVOF ( IDEV ) 
CALL JDEND ( IDEV ) 
CALL JEND 


STOP 

END 


B - 55 



Vertical Axle 


A Title 



Horizontal Axle 


A 


Figure CDR9. Line chart with a grid (without a legend). 


B - 56 



o o 


PROGRAM CDR9 


C 

C LINE CHART WITH A GRID (WITHOUT A LEGEND) 

C 

C ALLOCATE AND INITIALIZE DATA 

PARAMETER ( MAXPTS=1 0,MAXSET=2 ) 

REAL X(MAXPTS) , Y ( MAXPTS , MAXSET ) 

DATA X/5. 5, 6. 0,6. 5, 7. 0,7. 5, 8. 0,8. 5, 9. 0,9. 5, 10./ 

DATA (Y(KI,1 ) , KI=1 ,10) 

+ /.001 , .003, .0075, .004, .006, .008, .009, .005, .003, .002/ 

DATA (Y(KI,2) ,KI=1 ,10) 

+ /.0015, .004, .007, .0045, .0065, .0078 , ,0085 , .0055 , .0032 , .002/ 


WRITE TO THE DEVICE IDEV 
IDEV=0 
CALL CBEGIN 
CALL JBEGIN 
CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 



C ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC(9 . ,9. ) 

CALL JWINDO (0.,9.,0.,9.) 

CALL JOPEN 

C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 

CALL JSIZE( .2, .2*1 .25) 

C POSITION TEXT, AND SET TEXT JUSTIFICATION (CENTER, CENTER) 

CALL JMOVE(4.5,6.0) 

CALL JJUST( 2,2) 

C OUTPUT THE STRING 

CALL JHSTRG( 'A T[BLC] ITLE' ) 

C RESET THE CHARACTER SIZE FOR THE AXES 
CALL JSIZE( .1 , .1*1 .25) 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
XORG=2. 

YORG=2 . 

CALL JMOVE ( XORG , YORG ) 

C DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB( 'H[BLC]ORIZONTAL [ BUC ] A ( BLC ) X IS 1 ,1 ) 

C XLEN - REPRESENTS THE X-AXIS LENGTH 
XLEN=4 . 0 

CALL CHAXIS( 5 . , 1 0 . , 1 , , XLEN) 

C DESCRIBE THE VERTICAL AXIS 

CALL CVLAB ( ' V ( BLC ] ERTICAL (BUC]A(BLC]XIS' , 1 ) 

CALL CVPREC ( 3 ) 

C YLEN - REPRESENTS THE Y-AXIS LENGTH 
YLEN=3 . 5 

CALL CVAXIS ( .0, .01 , .001 , YLEN) 

C CALL GRID ROUTINE TO REQUEST GRID LINES TO BE OUTPUT OVER DATA AREA. 
NOINCX=NINT( ( 1 0.-5. )/1 . ) 

NOINCY=NINT( ( .01-.0)/.00l ) 

XS=XLEN/REAL ( NOINCX ) 

YS=YLEN/REAL ( NOINCY ) 

NBLANK=0 


B - 57 



o n 


CALL CGR ID ( XORG , YORG , XS , YS , NOINCX , NOINCY , BLANK , NBLANK) 

C SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV (XORG, YORG, 0., VX1 ,VY1 ) 

CALL JCONWV ( XORG+XLEN , YORG+ YLEN , 0 . , VX2 , VY2 ) 

C CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES) 

CALL JCLOSE 

C 

C SET WINDOW TO MATCH DATA COORDINATES, AND PLOT WITHIN BOUNDARIES 
C OF THE AXES (BY SAVED VIRTUAL COORDINATES) 

CALL JWINDO(5.,10.,.0, .01 ) 

C 5,10 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE X-DIRECTION 
C 0,.01 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE Y-DIRECTION 
CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 

C PLOT FIRST DATA CURVE USING CGL DEFAULTS 
CALL CSYMNO(I) 

CALL CLNPAT( 1 ) 

CALL CLNPLTf X, Y( 1,1), MAXPTS ) 

C SET SYMBOL NUMBER TO 2, AND PLOT SECOND DATA CURVE 
CALL CSYMNO( 2 ) 

CALL CLNPAT( 2 ) 

CALL CLNPLT(X,Y(1 ,2) , MAXPTS) 

CALL JCLOSE 


TERMINATE GRAPHICS 

CALL JPAUSE(IDEV) 

CALL JFRAME 

CALL JDEVOF(IDEV) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


B - 58 




on ooooo non o ooo no 


PROGRAM CDR10 




C SEMI-LOG LINE CHART WITH A GRID (SINGLE DATA SET) 



C SET UP DATA 

PARAMETER ( NPTS=6 ) 

REAL X ( NPTS ) , Y( NPTS ) , YTEMP ( NPTS ) , BLANK ( 4 ) 

DATA X/2. 2, 3. 0,4. 3, 5.1 ,5. 5, 6. 7/, BLANK/0. ,0. ,0. ,0./ 

DATA Y/3. ,50. ,10. ,50, ,75, ,98, / 

DATA XORG/2 . 5/ , YORG/2 . / , XLEN/7 ./ , YLEN/7 ./ , XPAGE/1 1 ./,YPAGE/1 1 ./ 


C SET UP GRAPHICS AREA 
IDEV=0 
CALL JBEGIN 
CALL CBEGIN 
CALL JDINIT(IDEV) 
CALL JDEVON ( IDEV ) 


SET PAGE COORDINATES, AND OPEN A TEMPORARY SEGMENT 
CALL JWINDO( 0 • , XPAGE, 0. , YPAGE) 

CALL JOPEN 


SET CHARACTER SIZE, AND OUTPUT TITLE 

SET THE CHARACTER SIZE (IN TERMS OF PAGE CORRDINATES ) 
XSIZE= . 25 

CALL JS IZE ( XSIZE, XS IZE* 1 .25) 

POSITION STRING, AND SET JUSTIFICATION (CENTER, BOTTOM) 
CALL JMOVE( XPAGE/2 . ,0.+XSIZE) 

CALL JJUST(2, 1 ) 

OUTPUT THE STRING 

CALL JHSTRG ( 1 P ( BLC ] OWER LEVEL VS. FREQUENCY') 


RESET THE CHARACTER SIZE FOR THE AXES 
XSIZE= . 2 

CALL JSIZE( XSIZE, XS IZE*1 .25) 

POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
CALL JMOVE ( XORG , Y ORG ) 


HORIZONTAL AXIS (LINEAR) 

CALL CMNMX ( X , NPTS , XMIN , XMAX ) 

DETERMINE PUBLICATION QUALITY SCALE FACTORS 

CALL CSCALE ( XMIN , XMAX , AMIN , AMAX , N MAJOR , NMINOR , XINCR , NLEFT , NRIGHT ) 
SET HORIZONTAL AXIS ATTRIBUTES 
CALL CHMTIC(NMINOR) 

CALL CHPREC( NRIGHT) 

CALL CHLAB( ' F [ BLC ] REQUENCY, [ BUC] H [BLC] Z ' , 1 ) 

CALL CH AXIS ( AMIN , AMAX , XINCR , XLEN ) 


VERTICAL AXIS (LOGARITHMIC) 

CALL CMNMX (Y, NPTS, YMIN,YMAX) 

CALL CEXP ( YMIN , YMAX, MINEXP , MAXEXP ) 
CALL CVLAB ( 1 P [ BLC ] OWER LEVEL', 1) 
CALL CSET( ' NVLOGF ' , 1 ) 

CALL CSET( 'NVLOGS' , MINEXP) 


B - 60 



on ooooooo no on 


NTIC=( MAXEXP-MINEXP) +1 
CALL CVLOG ( YLEN , NTIC , 1 ) 


GENERATE A GRID 
XSC=XLEN 

YSC=YLEN/REAL(NTIC-1 ) 

IXC=-1 
IYC=NTIC- 1 
XGS=0. 

YGS=1 . 

XGI=XLEN/REAL(NMAJ0R-1 ) 

YGI=1 . 

NBLANK=1 

CALL CLGRID ( XS C , YSC , I XC , I YC , XGS , YGS , XGI , YGI , BLANK , NBLANK ) 


SAVE DATA REGION VIRTUAL COORDINATES 
CALL JCONWV ( XORG , YORG , 0 . , VX 1 , VY 1 ) 

CALL JCONWV ( XORG+XLEN, YORG+YLEN.O. ,VX2,VY2) 
CALL JCLOSE 


SET VIEWPORT TO DATA REGION VIRTUAL COORDINATES 
CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 


SET UP DATA REGION WINDOW 
DO 1 KI=1 , NPTS 
1 YTEMP(KI ) =LOG1 0( Y(KI) ) 

X-AXIS IS LOG, MIN AND MAX MUST BE SCALED. 

CALL JWINDO ( AMIN, AMAX, REAL ( MINEXP ), REAL (MAXEXP) ) 
ENABLE CLIPPING TO EXCLUDE EXTRANEOUS DATA 
CALL JWCLIP ( .TRUE. ) 

CALL JOPEN 
PLOT DATA 

CALL CSYMNO(I) 

CALL CLNPAT(I) 

CALL CLNPLT ( X , YTEMP , NPTS ) 

CALL JPAUSE(IDEV) 

CALL JCLOSE 
CALL JFRAME 


TERMINATE GRAPHICS 

CALL JDEVOF(IDEV) 
CALL JDEND(IDEV) 
CALL JEND 


STOP 

END 


B - 61 





on no 


PROGRAM CDR1 1 




C COMPLETE LOW-LEVEL PROGRAM (WITH A KEY) AND A GRID 



C ALLOCATE AND INITIALIZE DATA 

PARAMETER ( MAXPTS=1 0,MAXSET=2) 

REAL X(MAXPTS) , Y (MAXPTS , MAXSET ) , BPOS(4) , BLANK ( 4 ) 

PARAMETER ( NLINS=2 ,NCOLS=1 ,NTLINS=1 ) 

CHARACTER KEYCHR( NCOLS , NLINS ) *20 
INTEGER ISTORE( 1 5, NLINS) , JCOL( NCOLS) 

DATA X/5. 5, 6. 0,6. 5 ,7. 0,7. 5, 8. 0,8. 5, 9. 0,9. 5, 10./ 

DATA JCOL/1 / 

DATA ( Y( KI , 1 ),KI=1 ,10) 

+ /.001 , .003, .0075, .004, .006, .008, .009, .005, .004, .005/ 

DATA ( Y(KI, 2) ,KI=1 ,10) 

+ /.001 5, .004, .007, .0045, .0065, .0078, .0085, .0055, .0035, .006/ 


WRITE TO THE DEVICE IDEV 
IDEV=0 
CALL CBEGIN 
CALL JBEGIN 
CALL JDINIT(IDEV) 
CALL JDEVON ( IDEV ) 


ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC( 9 . ,9.) 

CALL JWINDO(0. ,9. ,0. ,9. ) 

CALL JOPEN 

C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 
CSIZE=.2 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

C POSITION TEXT, AND SET TEXT JUSTIFICATION (CENTER, CENTER) 
CALL JMOVE( 4 .5,0.5) 

CALL JJUST( 2 , 2 ) 

C OUTPUT THE STRING 

CALL JHSTRG( 1 T[BLC] ITLE 1 ) 

C RESET THE CHARACTER SIZE FOR THE AXES 
CSIZE=. 1 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
XORG=2 . 

YORG=2 . 

CALL JMOVE ( XORG , YORG ) 

C DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB( ' H[BLC]ORIZONTAL (BUC] A [ BLC] XIS 1 ,1 ) 

C XLEN - REPRSENTS THE X-AXIS LENGTH 
XLEN=5 . 0 
CALL CHTICJ ( 0 ) 

CALL CHAXIS ( 5 . , 1 0 . , 1 . , XLEN ) 

C DESCRIBE THE VERTICAL AXIS 

CALL CVLAB( 1 V( BLC] ERTICAL [BUC ] A [ BLC] XIS ' , 1 ) 

CALL CVPREC ( 3 ) 

C YLEN - REPRESENTS THE Y-AXIS LENGTH 
YLEN=5 .0 


B - 63 



o o 


CALL CVAXIS( .0, .01 , .001 , YLEN ) 


SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV ( XORG , YORG , 0 . , VX1 , VY 1 ) 

CALL JCONWV ( XORG+XLEN , YORG+YLEN , 0 . , VX2 , VY2 ) 

C CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES) 

CALL JCLOSE 



C SET WINDOW TO MATCH DATA COORDINATES, AND PLOT WITHIN BOUNDARIES 
C OF THE AXES (BY SAVED VIRTUAL COORDINATES) 

CALL JWINDO(5. ,10. , .0, .01 ) 

C 5,10 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE X-DIRECTION 
C 0, .01 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE Y-DIRECTION 
CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 

CALL CKEYIN ( ISTORE , KEYCHR , NLINS , NCOLS , NTLINS ) 

C PLOT FIRST DATA CURVE USING CGL DEFAULTS 
CALL CSYMNO( 1 ) 

CALL CLNPAT(I) 

CALL CKEYLB( ISTORE, KEYCHR, 3, 'D[BLC]ATA SET 1') 

CALL CLNPLT( X, Y ( 1 ,1 ) , MAXPTS ) 

C SET SYMBOL NUMBER TO 2, AND PLOT SECOND DATA CURVE 
CALL CSYMNO( 2 ) 

CALL CLNPAT( 2 ) 

CALL CKEYLB( I STORE, KEYCHR, 3 , 'D[BLC] ATA SET 2') 

CALL CLNPLT ( X , Y ( 1 , 2 ) , MAXPTS ) 

CALL JCLOSE 



C NOW OUTPUT LEGEND AND GRID WITH A HOLE. 

C SET WINDOW AND VIEWPORT FOR PAGE COORDINATES 
CALL JVPORT (-1.,1.,-1.,1.) 

CALL JWINDO(0. ,9. ,0. ,9. ) 

CALL JOPEN 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

C FIRST CALL CKEYPL WITH KPT SET TO 3 TO OBTAIN KEY EXTENTS. 

KPT*1 

BP0SO ) =2 . 0 
BPOS ( 2) =2 . 0 
BPOS( 3 )=3 .0 
BP0S( 4) =3 .0 

CALL CKEYPL ( ISTORE, KEYCHR, ' K[ BLC 1 EY TITLE' , ’C( BLC] OLUMN TITLE’, 

+ BPOS, KPT , JCOL, 1 ) 

XXTENT=BPOS ( 3 ) - BPOS ( 1 ) 

YXTENT=BPOS ( 4 ) -BPOS ( 2 ) 

WRITE(77 , * ) 1 XXTENT, YXTENT® 1 , XXTENT, YXTENT 
C NOW BASED ON EXTENTS AND AXES, DETERMINE WHERE TO PLACE HOLE FOR KEY. 
C SET BPOS AND KPT ACCORDINGLY. 

XL=XLEN/5 . 

YL=YLEN/1 0 . 

BPOS( 1 ) = ( XORG+XLEN ) - ( ( XL* 3 • 0-XXTENT ) /2 . ) 

BPOS ( 2 ) =YORG+( ( YL*3 .-YXTENT) /2 . ) 

KPT=3 

CALL CKEYPL( ISTORE, KEYCHR, ’K[BLC]EY TITLE' ,' C [ BLC) OLUMN TITLE', 

+ BPOS, KPT, JCOL, 1 ) 


B - 64 



C NOW GENERATE GRID WITH APPROPRIATE HOLE. 

NOINCX=NINT( (10.-5. )/1 . ) 

NOINCY=NINT( ( .01-.0)/.001 ) 

XS=XLEN/REAL(NOINCX) 

YS=YLEN/REAL ( NOINCY ) 

NBLANK=1 

BLANK ( 1 ) =XORG+XL* 2 . 

BLANK ( 3 ) =XORG+XLEN 
BLANK ( 2) =YORG 
BLANK ( 4 ) =YORG+YL* 3 . 

CALL CGRID ( XORG , YORG , XS , YS , NOINCX , NOINCY , BLANK , N BLANK ) 
CALL JCLOSE 

C 

C TERMINATE GRAPHICS 

CALL JPAUSE(IDEV) 

CALL JFRAME 
CALL JDEVOF ( IDEV ) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


B - 65 





on on 


PROGRAM CDR12 




C A LINE CHART WITH A DECREASING AXIS. 



C ALLOCATE AND INITIALIZE DATA 

PARAMETER ( MAXPTS=1 0 , MAXSET=2 ) 

REAL X ( MAXPTS ) , Y ( MAXPTS , MAXS ET ) 

DATA X/5. 5, 6. 0,6. 5, 7. 0,7. 5, 8. 0,8. 5, 9. 0,9. 5, 10./ 

DATA (Y(KI, 1 ) ,KI=1 ,10) 

+ /.001 , .003, .0075, .004, .006, .008, .009, .005, .003, .002/ 

DATA ( Y(KI , 2 ) ,KI=1 ,10) 

+ /.001 5, .004, .007, .0045, .0065, .0078, .0085, .0055, .0032, .002/ 


WRITE TO THE DEVICE IDEV 
IDEV=0 
CALL CBEGIN 
CALL JBEGIN 
CALL JDINIT(IDEV) 
CALL JDEVON ( IDEV ) 


ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC(9. ,9. ) 

CALL JWINDO (0.,9.,0.,9.) 

CALL JOPEN 

C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 

CALL JSIZE( .2, .2*1 .25) 

C POSITION TEXT, AND SET TEXT JUSTIFICATION (CENTER, CENTER) 
CALL JMOVE (4. 5, 6.0) 

CALL J JUST (2, 2) 

C OUTPUT THE STRING 

CALL JHSTRG ( 1 A T[BLC] ITLE' ) 

C RESET THE CHARACTER SIZE FOR THE AXES 
CALL JSIZE( .1 ,.1*1.25) 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
XORG= 2 . 

YORG=2 . 

CALL JMOVE (XORG,YORG) 

C DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB( 'HtBLClRIZONTAL [BUC]A[BLCjXIS* , 1 ) 

C XLEN - REPRESENTS THE X-AXIS LENGTH 
XLEN=4.0 

CALL CHAXIS (10.,5.,-1. , XLEN ) 

C DESCRIBE THE VERTICAL AXIS 

CALL CVLAB( 1 V[BLC] ERTICAL tBUC] A[BLC]XIS' , 1 ) 

CALL CVPREC ( 3 ) 

C YLEN - REPRESENTS THE Y-AXIS LENGTH 
YLEN=3.5 

CALL CVAXIS( .0, .01 , .001 ,YLEN) 

C SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV ( XORG, YORG, 0. ,VX1 , VY1 ) 

CALL JCONWV ( XORG+XLEN , YORG+ YLEN, 0. ,VX2,VY2) 

C CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES) 

CALL JCLOSE 

c 


B - 67 


C SET WINDOW TO MATCH DATA COORDINATES, AND PLOT WITHIN BOUNDARIES 
C OP THE AXES (BY SAVED VIRTUAL COORDINATES) 

C NOTE: THE WINDOW OF THE UNDERLYING GRAPHICS PACKAGE MUST BE 
C INCREASING IN NATURE. THE RANGE MUST MATCH THE DATA. 

CALL JWINDO(5. ,10. , .0, .01 ) 

C 5,10 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE X-DIRECTION 
C 0,.01 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE Y-DIRECTION 
CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 

C FLIP THE DATA ABOUT A REFLECTION POINT (I.E., MIRROR IMAGE). 

C REFLECT = (XMAX-XMIN)/2. + XMIN 
REFLECT 3 (10. - 5.)/2. + 5. 

CALL CFLIP(X,MAXPTS, REFLECT) 

CALL JOPEN 

C PLOT FIRST DATA CURVE USING CGL DEFAULTS 
CALL CSYMNOO ) 

CALL CLNPAT(1 ) 

CALL CLNPLT (X,Y(1,1), MAXPTS ) 

C SET SYMBOL NUMBER TO 2, AND PLOT SECOND DATA CURVE 
CALL CSYMNO( 2 ) 

CALL CLNPAT ( 2 ) 

CALL CLNPLT ( X,Y (1,2) , MAXPTS ) 

CALL JCLOSE 

C IF THE X ARRAY IS TO BE USED AGAIN, THE USER MUST APPLY CFLIP AGAIN. 
C IN THIS CASE, THE X ARRAY IS NOT USED AGAIN. 



C TERMINATE GRAPHICS 

CALL JPAUSE(IDEV) 

CALL JFRAME 
CALL JDEVOF ( IDEV ) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


B - 68 




Wing length 


A Title 


Multiple axis 

Column title 

Decreasing axis 

Increasing axis 


Figure CDR13. Line chart with multiple vertical scales on the same axis 



on on o on on no 


PROGRAM CDR1 3 


C 

C A LINE CHART WITH MULTIPLE VERTICAL SCALES ON THE SAME AXIS. 

C 

C ALLOCATE AND INITIALIZE DATA 

PARAMETER ( MAXPTS=1 0 , MAXSET=2 ) 

REAL X ( MAXPTS ) , Y ( MAXPTS , MAXSET) , BPOS ( 4 ) 

PARAMETER ( NLINS=2 ,NCOLS=1 ,NTLINS=1 ) 

CHARACTER KEYCHR(NCOLS ,NLINS) *20 
INTEGER I STORE ( 1 5 , NLINS ) , JCOL ( NCOLS ) 

DATA X/5. 5, 6. 0,6. 5, 7. 0,7. 5, 8. 0,8. 5, 9. 0,9. 5, 10./ 

DATA JCOL/1 / 

DATA ( Y ( KI , 1 ) ,KI = 1 ,10) 

+ /.001 , .003, .0075, .004, .006, .008, .009, .005, .003, .002/ 

DATA ( Y( KI , 2 ) ,KI=1 ,10) 

+ /.001 5, .004, .007, .0045, .0065, .0078, .0085, .0055, .0032, .002/ 


WRITE TO THE DEVICE IDEV 
IDEV=0 
CALL CBEGIN 
CALL JBEGIN 
CALL JDINIT ( IDEV ) 
CALL JDEVON ( IDEV ) 


ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC ( 9 . , 9 . ) 

CALL JWINDO(0. ,9. ,0. ,9. ) 

CALL JOPEN 


SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 
CSIZE= . 2 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

POSITION TEXT, AND SET TEXT JUSTIFICATION (CENTER, CENTER) 
CALL JMOVE (4.5, . 5 ) 

CALL JJUST (2,2) 

OUTPUT THE STRING 

CALL JHSTRG( 'A T ( BLC] ITLE 1 ) 

RESET THE CHARACTER SIZE FOR THE AXES 
CSIZE= . 1 

CALL JSIZE(CSIZE,CSIZE*1 .25) 


POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
X0RG=2. 

Y0RG=2 . 

CALL JMOVE (XORG,YORG) 

C DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB( 'W[BLC]ING LENGTH ',1) 

C XLEN - REPRSENTS THE X-AXIS LENGTH 
XLEN=4 . 0 

CALL CHAXIS ( 5 . , 1 0 . , 1 ,,XLEN) 

C 

C DESCRIBE THE VERTICAL AXIS 
C NO AXIS LABEL ON INNERMOST VERTICAL AXIS 
CALL CVLAB( ' ' ,0) 


I 


B - 70 



o o 


CALL CVPREC( 3 ) 

C YLEN - REPRESENTS THE Y-AXIS LENGTH 
YLEN=3. 5 

C PLOT FIRST AXIS (DECREASING) 

CALL CVAXISt .01 , .0,-.001 ,YLEN) 

CALL JMOVE ( XORG , YORG+YLEN+ .75) 

CALL JHSTRG{ ' [BLC] CM' ) 

C PLOT SECOND AXIS (INCREASING) 

C POSITION AND DESCRIBE THE OUTMOST VERTICAL AXIS 
CALL JMOVE(XORG-CSIZE*7. ,YORG) 

CALL CVLAB ( ' W ( BLC ] ING WIDTH ',1 ) 

CALL CVAXIS ( .0, .01 , .001 , YLEN ) 

C LABEL FOR OUTMOST VERTICAL AXIS 

CALL JMOVE(XORG-CSIZE*7. ,YORG+YLEN+.75) 

CALL JHSTRG( ' (BLC) IN. ' ) 


SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV ( XORG , Y ORG , 0 • ,VX1 ,VY1 ) 

CALL JCONWV ( XORG+ XL EN , YORG+ YL EN , 0 . , V X 2 , V Y 2 ) 

C CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES) 

CALL JCLOSE 

C 

C SET WINDOW TO MATCH DATA COORDINATES, AND PLOT WITHIN BOUNDARIES 
C OF THE AXES (BY SAVED VIRTUAL COORDINATES) 

CALL JWINDO(5. ,10.,.0, .01 ) 

C 5,10 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE X-DIRECTION 
C 0, .01 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE Y-DIRECTION 
CALL JVPORT( VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 

CALL CKEYIN ( ISTORE , KEYCHR , NL INS , NCOLS , NTLINS ) 

C FLIP THE DATA ABOUT A REFLECTION POINT (I.E., MIRROR IMAGE). 

C REFLECT = (YMAX-YMIN)/2. + YMIN 
REFLECT=( .01 - 0.)/2. + 0. 

CALL CFLIP(Y(1 ,1 ),MAXPTS, REFLECT) 

C PLOT FIRST DATA CURVE WITH DECREASING AXIS (USING CGL DEFAULTS) 

CALL CSYMNO( 1 ) 

CALL CLNPAT(I) 

CALL CKEYLB( I STORE, KEYCHR, 3 , 1 D [ BLC] ECREASING AXIS DATA SET 1’) 
CALL CLNPLT ( X , Y ( 1 , 1 ) , MAXPTS ) 

C REVERSE DATA AGAIN, TO RETURN DATA TO ORIGINAL VALUES. 

CALL CFLIP( Y (1,1), MAXPTS , REFLECT ) 

C SET SYMBOL NUMBER TO 2, AND PLOT SECOND DATA CURVE 
CALL CSYMNO( 2) 

CALL CLNPAT ( 2 ) 

CALL CKEYLB (I STORE, KEYCHR, 3, 1 I [BLC INCREASING AXIS DATA SET 2') 

C PLOT SECOND DATA CURVE WITH INCREASING AXIS. 

CALL CLNPLT ( X , Y ( 1 ,1 ) , MAXPTS ) 

CALL JCLOSE 



C NOW OUTPUT LEGEND 

C SET WINDOW AND VIEWPORT FOR PAGE COORDINATES 
CALL JVPORT (-1.,1.,-1.,1.) 

CALL JWINDO(0. ,9. ,0. ,9. ) 

BPOS ( 1 ) =9 . 


B - 71 



BPOS(2)=2.+3.5 
CALL JOPEN 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

CALL CKEYPL ( ISTORE , KEYCHR , ' M [ BLC ] ULTIPLE AXIS', 
+ 'CtBLClOLUMN TITLE' , BPOS , 5 , JCOL, 1 ) 

CALL JCLOSE 

C 

C TERMINATE GRAPHICS 

CALL JPAUSE(IDEV) 

CALL JFRAME 
CALL JDEVOF(IDEV) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


B - 72 



Decreasing axis 



Multiple axis 


Data type 

O Decreasing data 

□ Increasing data 


Horizontal Axis 


A Title 


Figure CDR14. Line chart with multiple vertical scales (opposite axis). 


B - 73 



no on no ooo 


PROGRAM CDR14 




LINE CHART WITH MULTIPLE VERTICAL SCALES (OPPOSITE AXIS) 


ALLOCATE AND INITIALIZE DATA 

PARAMETER ( MAXPTS=1 0, MAXSET=2 ) 

REAL X(MAXPTS) , Y( MAXPTS , MAXSET) ,BPOS(4) 

PARAMETER (NLINS=2,NCOLS=1 ,NTLINS=1 ) 

CHARACTER KEYCHR(NCOLS , NLINS ) *20 
INTEGER ISTORE( 1 5, NLINS) , JCOL(NCOLS) 

DATA X/5. 5, 6. 0,6. 5, 7. 0,7. 5, 8. 0,8. 5, 9. 0,9. 5, 10./ 

DATA JCOL/1 / 

DATA ( Y(KI, 1 ) ,KI=1 ,10) 

+ /.001 , .003, .0075, .004, .006, .008, .009, .005, .003, .002/ 

DATA ( Y(KI , 2) ,KI=1 ,10) 

+ /.001 5, .004, .007, .0045, .0065, .0078, .0085, .0055, .0032, .002/ 


WRITE TO THE DEVICE IDEV 
IDEV=0 
CALL CBEGIN 
CALL JBEGIN 
CALL JDINIT(IDEV) 
CALL JDEVON ( IDEV ) 


ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC(9. ,9. ) 

CALL JWINDO(0. ,9.,0.,9.) 

CALL JOPEN 


SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 
CSIZE=.2 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

C POSITION TEXT, AND SET TEXT JUSTIFICATION (CENTER, CENTER) 
CALL JMOVE (4.5, .5) 

CALL JJUST( 2,2) 

C OUTPUT THE STRING 

CALL JHSTRGCA T[BLC] ITLE' ) 

C RESET THE CHARACTER SIZE FOR THE AXES 
CSIZE=. 1 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

C 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
XORG= 1 .25 
YORG=2 . 

CALL JMOVE (XORG,YORG) 

C DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB( 'H(BLC]ORIZONTAL [BUC]A[BLC]XIS' , 1 ) 

C XLEN - REPRSENTS THE X-AXIS LENGTH 
XLEN=4 .0 

CALL CHAXIS ( 5 . , 1 0 . , 1 . ,XLEN ) 

C 

C DESCRIBE THE VERTICAL AXIS 
C NO AXIS LABEL ON INNERMOST VERTICAL AXIS 
CALL CVLAB( 1 D [BLC] ECREASING AXIS',1) 


B - 74 



o o 


CALL CVPREC ( 3 ) 

C YLEN - REPRESENTS THE Y-AXIS LENGTH 
YLEN=3 . 5 

C PLOT FIRST AXIS (DECREASING) 

CALL CVAXIS( .01 , .0,-.001 , YLEN ) 

C PLOT SECOND AXIS (INCREASING) 

C POSITION AND DESCRIBE THE OPPOSITE VERTICAL AXIS 
CALL JMOVE ( XORG+XLEN , YORG ) 

C REQUEST VERTICAL AXIS TICK MARKS TO THE RIGHT OF THE AXIS. 

C CALL CVTIC J ( 2 ) 

C REQUEST VERTICAL AXIS TICK MARK LABELS TO THE RIGHT OF THE AXIS. 
CALL CVLABJ ( 1 ) 

CALL CVTICJ ( 2 ) 

CALL CVLAB( 'I [BLC] NCR EASING AXIS',1) 

CALL CVAXIS ( .0, .01 , .001 , YLEN) 


SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV ( XORG, YORG , 0 . , VX1 , VY1 ) 

CALL JCONWV ( XORG+XLEN, YORG+YLEN,0. ,VX2,VY2) 

C CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES) 

CALL JCLOSE 

C 

C SET WINDOW TO MATCH DATA COORDINATES, AND PLOT WITHIN BOUNDARIES 
C OF THE AXES (BY SAVED VIRTUAL COORDINATES) 

CALL JWINDO(5.,10.,.0,.01 ) 

C 5,10 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE X-DIRECTION 
C 0, .01 - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE Y-DIRECTION 
CALL JVPORTt VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 

CALL CKEY IN ( I STORE ,KEYCHR,NLINS, NCOLS , NTL INS ) 

C FLIP THE DATA ABOUT A REFLECTION POINT (I.E., MIRROR IMAGE). 

C REFLECT = (YMAX-YMIN)/2. + YMIN 
REFLECTS .01 - 0.)/2. + 0. 

CALL CFLIP(Y(1 ,1 ) ,MAXPTS, REFLECT) 

C PLOT FIRST DATA CURVE WITH DECREASING AXIS 
CALL CSYMNO( 1 ) 

CALL CLNPAT ( 1 ) 

CALL CKEYLB( ISTORE,KEYCHR, 3, ' D[BLC] ECREASING DATA') 

CALL CLNPLT(X,Y(1 , 1 ) ,MAXPTS) 

C REVERSE DATA AGAIN, TO RETURN DATA TO ORIGINAL VALUES. 

CALL CFLIP(Y(1 ,1 ) ,MAXPTS, REFLECT) 

C SET SYMBOL NUMBER TO 2, AND PLOT SECOND DATA CURVE 
CALL CSYMNO( 2) 

CALL CLNPAT ( 2 ) 

CALL CKEYLB( ISTORE, KEYCHR, 3, ' I (BLC INCREASING DATA’) 

C PLOT SECOND DATA CURVE WITH INCREASING AXIS. 

CALL CLNPLT( X, Y ( 1,2), MAXPTS ) 

CALL JCLOSE 

C 

C NOW OUTPUT LEGEND 

C SET WINDOW AND VIEWPORT FOR PAGE COORDINATES 
CALL JVPORT (— 1 .,1.,— 1.,1 .) 

CALL JWINDO(0. ,9. ,0. ,9. ) 

BPOS ( 1 ) =9 . 


B - 75 


BPOS( 2) =2 .+3.5 
CALL JOPEN 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

CALL CKEYPL ( ISTORE , KEYCHR , ' M [ BLC ] ULTIPLE AXIS', 
+ ' D t BLC ] ATA TYPE ' , BPOS , 5 , JCOL , 1 ) 

CALL JCLOSE 



C TERMINATE GRAPHICS 

CALL JPAUSE(IDEV) 

CALL JFRAME 
CALL JDEVOF(IDEV) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


B - 76 



Computations vs Experiments 



Multiple axle 

Data type 

O Experimental 

■ Actual 


Figure CDR15. Simple, yet complete low-level program (with a key). 


B - 77 


no no oo o no oo oo 


PROGRAM CDR1 5 


C 

C SIMPLE, YET COMPLETE LOW-LEVEL PROGRAM (WITH A KEY) 

C 

C ALLOCATE AND INITIALIZE DATA 

PARAMETER (NUMPT1 =1 3 ,NUMPT2=3 , MAXLAB=20 ) 

REAL XI (NUMPT1 ) , Y1 (NUMPT1 ) , BPOS ( 4 ) 

REAL X2( NUMPT2 ) , Y2( NUMPT2 ) 

PARAMETER ( NLINS=2 ,NCOLS=1 ,NTLINS=1 ) 

CHARACTER KEYCHR ( NCOLS , NLINS ) *20 , CLABS ( MAXLAB ) * 1 0 
INTEGER ISTORE{ 15, NLINS ) , JCOL(NCOLS) 

DATA XI /— 8 • , “6 * , — 4 • , — 2 • ,0* , 2* , 4 • , 6 • ,8, , 1 0* ,1 2 * ,1 4» , 1 6, / 
DATA JCOL/1 / 

DATA (Y1 (KI) ,KI=1 ,NUMPT1 ) 

+ /.079, .068, .035, .021 , .0,-.021 , - .035 , - .065 , - .08 , - . 1 1 , 

+ -.118, -.12, -.139/ 

DATA X2/-4 . , 8 . , 1 6 . / , Y2/ . 039 , - .071 ,-.145/ 


WRITE TO THE DEVICE IDEV 
IDEV=0 
CALL CBEGIN 
CALL JBEGIN 
CALL JDINIT ( IDEV ) 
CALL JDEVON ( IDEV ) 


ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC(9. ,9.) 

CALL JWINDO(0. ,9. ,0. ,9. ) 

CALL JOPEN 


SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 

CSIZE= . 2 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

POSITION TEXT, AND SET TEXT JUSTIFICATION (CENTER, TOP) 

CALL JMOVE (9./2.,9.-.5) 

CALL JJUST( 2,3) 

OUTPUT THE STRING 

CALL JHSTRG( 1 C[BLC]OMPUTATIONS VS(ELC] E[BLC] XPERIMENTS' ) 
RESET THE CHARACTER SIZE FOR THE AXES 
CSIZE= . 1 

CALL JSIZE(CSIZE,CSIZE*1 .25) 


BASED AXES DATA ATTRIBUTES (MINIMUM, MAXIMUM, AND INCREMENTS). 
XMIN=-8 . 

XMAX=20. 

XINC=4 . 

YMIN=- .16 
YMAX=0 . 1 2 
YINC= .04 


SET X AND Y AXIS LENGTHS (I.E., XLEN AND YLEN RESPECTIVELY). 
XLEN=4 . 0 
YLEN=5 . 5 

C POSITION LOWER-LEFT CORNER OF DATA SPACE ON THE PAGE. 


B - 78 


O 9 no o ooo on o ooo 


XORG=( (9./2. )-1 . )-.5*XLEN 
YORG=(9./2. )-.5*YLEN 

C NOW, SET XZERO AND YZERO PAGE COORDINATES WHERE AXES 0,0 EXISTS. 
C (THIS PROGRAM ASSUMES THAT DATA ENCOMPASSES 0,0 IN X AND Y) . 
XZERO=XORG+XLEN* (-XMIN/ (XMAX-XMIN) ) 

YZERO=YORG+YLEN* ( -YMIN/ ( YMAX-YMIN) ) 


DESCRIBE X-AXIS. MOVE TO X ORIGIN, Y ZERO. 

CALL JMOVE (XORG, YZERO) 

GENERATE X AXIS LABELS. 

CALL CILAB( XMIN, XMAX , XINC , 0 ,CLABS ) 
ICOUNT=NINT( ( XMAX-XMIN) /XINC)+1 
BLANK OUT INTERSECTION LABEL (I.E., 0). 
KI=NINT( ABS (XMIN) /XINC )+1 
CLABS(KI)*' ' 

DRAW AXIS 

CALL CHAXIC( XLEN, ICOUNT,CLABS, 1 ,IC0UNT) 
POSITION AND OUTPUT AXIS LABEL 

CALL JMOVE ( XORG+ ( 5 . /7 . ) * XLEN , YZERO- . 5 ) 
CALL JHSTRG( ' [FONT=9] [BLCl A[FONT=3] , DEG' ) 


DESCRIBE Y-AXIS. MOVE TO X ZERO, Y ORIGIN. 

CALL JMOVE ( XZERO, YORG) 

GENERATE Y AXIS LABELS. 

CALL CILAB( YMIN, YMAX , YINC, 2 ,CLABS ) 
ICOUNT=NINT( ( YMAX-YMIN) /YINC) +1 
BLANK OUT INTERSECTION LABEL (I.E., 0). 
KI=NINT( ABS ( YMIN ) /YINC ) +1 
CLABS(KI)=' ' 

DRAW AXIS. 

CALL CVAX IC ( YLEN , ICOUNT , CL ABS , 1 , ICOUNT ) 
POSITION AND OUTPUT AXIS LABEL 

CALL JMOVE ( XZERO- 1 . , YORG+ ( 2 . 5/7 . ) *YLEN ) 
CALL JHSTRG( *C(BLC] [BSUB]M (0.25C)') 


SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV ( XORG , YORG ,0.,VX1, VY1 ) 

CALL JCONWV ( XORG+XLEN , YORG+ YLEN, 0. ,VX2,VY2) 

C CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES) 

CALL JCLOSE 



C SET WINDOW TO MATCH DATA COORDINATES, AND PLOT WITHIN BOUNDARIES 
C OF THE AXES (BY SAVED VIRTUAL COORDINATES) 

CALL JWINDO( XMIN, XMAX, YMIN, YMAX) 

C XMIN, XMAX - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE X-DIRECTION 
C YMIN, YMAX - REPRESENTS THE DATA COORDINATE BOUNDARIES IN THE Y-DIRECTION 
CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 

CALL CKEYIN ( I STORE , KEYCHR , NLINS , NCOLS ,NTLINS ) 

C PLOT FIRST DATA CURVE USING CGL DEFAULTS 
C SET SYMBOL TO 1 (A CIRCLE) FOR EXPERIMENTAL DATA. 

CALL CSYMNOO ) 

CALL CKEYLB( ISTORE, KEYCHR, 3 , ' E[BLC ] XPERIMENTAL' ) 

CALL CLNPLT(X) ,Y1 ,NUMPT1 ) 


B - 79 



C PLOT SECOND DATA CURVE. 

C SET SYMBOL TO SOLID SQUARE (ACTUAL), AND PLOT SYMBOLS ONLY. 
CALL CSYMNO(902) 

CALL CPLTYP(-I) 

CALL CKEYLB(ISTORE,KEYCHR,3, ' A [ BLC ] CTUAL ' ) 

CALL CLNPLT ( X2 , Y2 , NUMPT2 ) 

CALL JCLOSE 

C 

C NOW OUTPUT LEGEND 

C SET WINDOW AND VIEWPORT FOR PAGE COORDINATES 
CALL JVPORT (-1.,1.,-1.,1.) 

CALL JWINDO (0.,9.,0.,9.) 

BPOS ( 1 )=9 . 

BPOS ( 2) =2 . + 3 . 5 
CALL JOPEN 

CALL JSIZE(CSIZE,CSIZE*1 .25) 

CALL CKEYPL( ISTORE,KEYCHR, ' M[ BLC ] ULTIPLE AXIS', 

+ 1 D [ BLC ] ATA TYPE ‘ , BPOS , 5 , JCOL , 1 ) 

CALL JCLOSE 

C 

C TERMINATE GRAPHICS 

CALL JPAUSE(IDEV) 

CALL JFRAME 
CALL JDEVOF ( IDEV ) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


B - 80 



A Title 



Horizontal Axis 


Figure CDR16. Line chart with disjoint axes (based on CDR4). 


B - 81 


on on noon no 


PROGRAM CDR16 


C 

LINE CHART WITH DISJOINT AXES (BASED ON CDR6) 


THE KEY ELEMENTS INVOLVING DISJOINT AXES INCLUDE: 

- THE POSITIONING OF THE AXES (SEE XOFF AND YOFF) , 

- THE SETTING OF THE VIEWPORT TO MATCH THE DATA SPACE 
(WHICH DIFFERS FROM THE AXES BOUNDARIES). 


ALLOCATE AND INITIALIZE DATA 

PARAMETER (MAXPTS=1 0 , MAXSET=2) 

REAL X( MAXPTS ) , Y ( MAXPTS , MAXSET) 

DATA X/5. 5, 6. 0,6. 5, 7. 0,7. 5, 8. 0,8. 5, 9. 0,9. 5, 10./ 

DATA ( Y(KI , 1 ) ,KI = 1 ,10) 

+ /.001 , .003, .0075, .004, .006, .008, .009, .005, .003, .002/ 

DATA ( Y( KI , 2 ) ,KI=1 ,10) 

+ /.001 5, .004, .007, .0045, .0065, .0078, .0085, .0055, .0032, .002/ 


WRITE TO THE DEVICE IDEV 
IDEV=0 
CALL CBEGIN 
' call' JBEGIN 

CALL JDINIT(IDEV) 

CALL JDEVON ( IDEV ) 



C ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC( 9 . , 9 . ) 

CALL JWINDO(0. ,9. ,0. ,9. ) 

CALL JOPEN 

C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 

CALL JSIZE( .2, .2*1 .25) 

C POSITION STRING, AND SET JUSTIFICATION (CENTER, CENTER) 

CALL JMOVE( 4 .5,6.0) 

CALL JJUST( 2,2) 

C OUTPUT THE STRING 

CALL JHSTRG( 'A T(BLC] ITLE' ) 

C RESET THE CHARACTER SIZE FOR THE AXES 
CALL JSIZE( .1 , .1 *1 .25) 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
C XOFF - THE DISTANCE TO SHIFT THE X-AXIS DOWN. 

XOFF= . 2 

CALL JMOVE ( 2 . , 2 . - ( XOFF ) ) 

C DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB( 'HtBLCjORIZONTAL [ BUC ] A [ BLC ) XI S ' ,1 ) 

CALL CHAXIS (5. ,10. , 1 . ,4. ) 

C DESCRIBE THE VERTICAL AXIS 

CALL CVLAB( ' V[ BLC] ERTICAL [ BUC] A[BLC] XIS ’ , 1 ) 

CALL CVPREC ( 3 ) 

C YOFF - THE DISTANCE TO SHIFT THE Y-AXIS LEFT. 

YOFF=.2 

CALL JMOVE (2. -YOFF, 2. ) 

CALL CVAXIS( .0, .01 , .001 ,3.5) 

C SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 

C NOTE: THE VIRTUAL COORDINATES ARE BASED ON DIMENSIONS OF DATA 


B - 82 



n o 


c SPACE, NOT ON AXIS BOUNDARIES. 

CALL JCONWV ( 2 . , 2 . , 0 . , VX1 , VY 1 ) 

CALL JCONWV (2. + 4. ,2. + 3. 5, 0. ,VX2,VY2) 

C CLOSE CURRENT WORLD COORDINATES (PAGE COORDINATES) 

CALL JCLOSE 

C 

C SET WINDOW TO MATCH DATA COORDINATES, AND PLOT WITHIN BOUNDARIES 
C OF THE AXES (BY SAVED VIRTUAL COORDINATES) 

CALL JWINDO(5. ,10. , .0, .01 ) 

CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 

C PLOT FIRST DATA CURVE USING CGL DEFAULTS 
CALL CSYMNO( 1 ) 

CALL CLNPAT( 1 ) 

CALL CLNPLT( X, Y ( 1 , 1 ) , MAXPTS ) 

C SET SYMBOL NUMBER TO 2, AND PLOT SECOND DATA CURVE 
CALL CSYMNO( 2 ) 

CALL CLNPAT( 2) 

CALL CLNPLT(X,Y(1 ,2) , MAXPTS) 

CALL JCLOSE 


TERMINATE GRAPHICS 

CALL JPAUSE(IDEV) 

CALL JFRAME 

CALL JDEVOF ( IDEV ) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


B - 83 



Vertical Axis 


CHTICJ : IMPROPER ENTRY GIVEN FOR POSITIONING 

OF TICKMARKS. VALUE MUST BE 0, 1, 

2, OR 3. DEFAULT VALUE OF 1 IS USED. 


A Title 



Horizontal Axis 


Figure CDD1 . Example showing a simple CGL error. 


B - 84 



no o o 


PROGRAM CDD1 




C AN EXAMPLE SHOWING A SIMPLE CGL ERROR. 



C ALLOCATE AND INITIALIZE DATA 
PARAMETER ( MAXPTS=5 ) 

REAL X(MAXPTS) ,Y(MAXPTS) 

DATA X/5. 5, 6. 5, 7. 5, 8. 5, 9. 5/, Y/. 001 , .0075, .006, .009, .002/ 


WRITE TO THE METAFILE 
IDEV=0 
CALL CBEGIN 
CALL JBEGIN 
CALL JDINIT(IDEV) 
CALL JDEVON ( IDEV ) 


ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC(9. ,9.) 

CALL JWINDO (0.,9.,0.,9.) 

CALL JOPEN 

C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 

CALL JSIZE( .2, .2*1 .25) 

C POSITION TEXT, AND SET TEXT JUSTIFICATION (CENTER, CENTER) 
CALL JMOVE ( 4 . 5 , 6 . 0 ) 

CALL JJUST( 2,2) 

C OUTPUT THE STRING 

CALL JHSTRGCA T(BLC)ITLE') 

C RESET THE CHARACTER SIZE FOR THE AXES 
CALL JSIZE( .1 , .1 *1 .25) 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
XORG=2 . 

YORG=2 . 

CALL JMOVE (XORG,YORG) 

C DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB( 'H[BLC]ORIZONTAL [BUC]A[BLC]XIS' , 1 ) 

CALL CHTICJ(-I) 

C XLEN - REPRESENTS THE X-AXIS LENGTH 
XLEN=4 .0 

CALL CHAXIS( 5 • , 1 0. , 1 . , XLEN ) 

C DESCRIBE THE VERTICAL AXIS 

CALL CVLAB ( ' V ( BLC ] ERTICAL [ BUC ] A [ BLC ] XIS 1 ,1 ) 

CALL CVPREC( 3) 

C YLEN - REPRESENTS THE Y-AXIS LENGTH 
YLEN=3 . 5 

CALL CVAXIS( .0, .01 , .01 ,YLEN) 

C SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV ( XORG, YORG, 0 . ,VX1 , VY1 ) 

CALL JCONWV (XORG+ XL EN,Y0RG+ YLEN, 0. ,VX2,VY2) 

CALL JCLOSE 

C 

C SET WINDOW TO MATCH DATA COORDIATES, AND PLOT WITHIN 
C BOUNDARIES OF THE AXES (BY SAVE VIRTUAL COORDINATES) 

CALL JWINDO(5. ,10. , .0, .01 ) 

C 5,10 - REPRESENTS THE DATA BOUNDARIES IN THE X-DIRECTION 


B - 85 


C 0,.01 - REPRESENTS THE DATA BOUNDARIES IN THE Y-DIRECTION 
CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 
C PLOT DATA CURVE 

CALL CSYMNOd ) 

CALL CLNPAT(I) 

CALL CLNPLT ( X , Y , MAXPTS ) 

CALL JCLOSE 

C 

CALL JPAUSE(IDEV) 

CALL JFRAME 
CALL JDEVOF(IDEV) 

CALL JDEND(IDEV) 

CALL JEND 
STOP 




o o o o on 


PROGRAM CDD2 




C AN EXAMPLE SHOWING A DEBUGGING CAPABILITIES. 

C 

C ALLOCATE AND INITIALIZE DATA 
PARAMETER ( MAXPTS=5) 

REAL X(MAXPTS) , Y(MAXPTS) 

DATA X/5. 5, 6. 5, 7. 5, 8. 5, 9. 5/, Y/. 001 , .0075, .006, .009, .002/ 


WRITE TO THE METAFILE 
IDEV=0 
CALL CBEGIN 
CALL JBEGIN 
CALL JDINIT(IDEV) 
CALL JDEVON ( IDEV ) 


DEBUGGING TURNED ON FOR USER-CALLABLE ROUTINES. 
CALL CDEBUG(I) 


ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC(9. ,9. ) 

CALL JWINDO (0.,9.,0.,9.) 

CALL JOPEN 

C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 

CALL JSIZE( .2, .2*1 .25) 

C POSITION TEXT, AND SET TEXT JUSTIFICATION (CENTER, CENTER) 
CALL JMOVE ( 4 . 5 , 6 . 0 ) 

CALL JJUST( 2,2) 

C OUTPUT THE STRING 

CALL JHSTRG('A T[BLC] ITLE' ) 

C RESET THE CHARACTER SIZE FOR THE AXES 
CALL JSIZE( .1 , .1*1 .25) 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
XORG*2. 

YORG=2. 

CALL JMOVE (XORG,YORG) 

C DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB( 'HtBLCjORIZONTAL [BUC] A[BLC] XIS ' , 1 ) 

C XLEN - REPRESENTS THE X-AXIS LENGTH 
XLEN=4 • 0 

CALL CHAXIS( 5 . , 10. , 1 . , XLEN) 

C DESCRIBE THE VERTICAL AXIS 

CALL CVLAB ( ' V ( BLC ) ERTICAL [ BUC] A[ BLC) XIS ' , 1 ) 

CALL CVPREC ( 3 ) 

C YLEN - REPRESENTS THE Y-AXIS LENGTH 
YLEN=3 .5 

CALL CVAXIS( .0, .01 , .01 ,YLEN) 

C SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV( XORG, YORG, 0. ,VX1 ,VY1 ) 

CALL JCONWV ( XORG+XLEN , YORG+ YLEN , 0 . , VX2 , VY 2 ) 

CALL JCLOSE 



C SET WINDOW TO MATCH DATA COORDIATES, AND PLOT WITHIN 
C BOUNDARIES OF THE AXES (BY SAVE VIRTUAL COORDINATES) 


B - 88 



CALL JWINDO(5.,10.,.0,.01) 

C 5,10 - REPRESENTS THE DATA BOUNDARIES IN THE X-DIRECTION 
C 0, .01 - REPRESENTS THE DATA BOUNDARIES IN THE Y-DIRECTION 
CALL JVPORT(VXl ,VX2,VY1 ,VY2) 

CALL JOPEN 
C PLOT DATA CURVE 

CALL CSYMNO( 1 ) 

CALL CLNPAT(I) 

CALL CLNPLT ( X , Y , MAXPTS ) 

CALL JCLOSE 

C 

CALL JPAUSE(IDEV) 

CALL JFRAME 
CALL JDEVOF { IDEV ) 

CALL JD END (IDEV) 

CALL JEND 

STOP 

END 


B - 89 



o o n o on 


PROGRAM CDD3 


C 

C AN EXAMPLE SHOWING A ERROR AND DEBUGGING REDIRECTION. 

C 

C ALLOCATE AND INITIALIZE DATA 
PARAMETER (MAXPTS=5) 

REAL X ( MAXPTS ) , Y ( MAXPTS ) 

DATA X/ 5. 5,6. 5, 7. 5, 8. 5, 9. 5/, Y/. 001 , .0075, .006, .009, .002/ 


WRITE TO THE METAFILE 
IDEV=0 
CALL CBEGIN 
CALL JBEGIN 
CALL JDINIT(IDEV) 
CALL JDEVON ( IDEV ) 


' WRITE CGL ERROR MESSAGES TO UNIT 
CALL CFILES( 1 ,80, 1 TAPE80 1 ) 

1 

1 

1 o 
1 00 

FILE 

•TAPE80' . 

: WRITE CGL DEBUG MESSAGES TO UNIT 
CALL CFILES (2,80, * TAPE80 ' ) 

00 

o 

FILE 

' TAPE80 ' . 

! DEBUGGING TURNED ON FOR USER-CALLABLE 
CALL CDEBUG(I) 

ROUTINES. 


C ESTABLISH THE PAGE COORDINATES AND VIEWSPACE 
CALL CVSPAC(9. ,9. ) 

CALL JWINDO(0. , 9. ,0. ,9.) 

CALL JOPEN 

C SET THE CHARACTER SIZE (IN TERMS OF PAGE COORDINATES) 
CALL JSIZE( .2, .2*1 .25) 

C POSITION TEXT, AND SET TEXT JUSTIFICATION (CENTER, CENTER) 
CALL JMOVE ( 4 . 5 , 6 . 0 ) 

CALL JJUST( 2,2) 

C OUTPUT THE STRING 

CALL JHSTRGCA T [BLC] ITLE* ) 

C RESET THE CHARACTER SIZE FOR THE AXES 
CALL JSIZEt .1 , .1 *1 .25) 

C POSITION THE LOWER-LEFT INTERSECTION OF THE AXES 
XORG=2 . 

YORG=2 . 

CALL JMOVE (XORG,YORG) 

C DESCRIBE THE HORIZONTAL AXIS 

CALL CHLAB( 1 H ( BLC ] ORIZONTAL ( BUC ] A [ BLC) XIS ’ , 1 ) 

CALL CHTICJ ( - 1 ) 

C XLEN - REPRESENTS THE X-AXIS LENGTH 
XLEN=4 .0 

CALL CHAXIS ( 5 . , 1 0. , 1 ., XLEN ) 

C DESCRIBE THE VERTICAL AXIS 

CALL CVLAB( ' V( BLC] ERTICAL [BUC]A[BLC]XIS' , 1 ) 

CALL CVPREC ( 3 ) 

C YLEN - REPRESENTS THE Y-AXIS LENGTH 
YLEN=3 . 5 

CALL CVAXIS( .0, .01 , .01 , YLEN) 


B - 91 



C SAVE VIRTUAL COORDINATES OF AXES BOUNDARIES 
CALL JCONWV ( XORG , YORG , 0 . ,VX1 ,VY1 ) 

CALL JCONWV ( XORG+XLEN, YORG+YLEN, 0 • ,VX2 , VY2) 

CALL JCLOSE 

C 

C SET WINDOW TO MATCH DATA COORDIATES, AND PLOT WITHIN 
C BOUNDARIES OF THE AXES (BY SAVE VIRTUAL COORDINATES) 

CALL JWINDO(5. ,10., .0, .01 ) 

C 5,10 - REPRESENTS THE DATA BOUNDARIES IN THE X-DIRECTION 
C 0,.01 - REPRESENTS THE DATA BOUNDARIES IN THE Y-DIRECTION 
CALL JVPORT(VX1 ,VX2,VY1 ,VY2) 

CALL JOPEN 
C PLOT DATA CURVE 

CALL CSYMNO(I) 

CALL CLNPAT( 1 ) 

CALL CLNPLT ( X , Y , MAXPTS ) 

CALL JCLOSE 

C 

CALL JPAUSE(IDEV) 

CALL JFRAME 
CALL JDEVOF ( IDEV) 

CALL JDEND(IDEV) 

CALL JEND 

STOP 

END 


B - 92 



Frequency, Hz 


Power level vs. frequency 


Figure CDLL1 . Program interfacing the low-level routines with the 
LEZ Routines. 


COLLI 



uu 6 o «- 6 u o o 


PROGRAM CDLL1 


C 

PROGRAM INTERFACING THE LOW-LEVEL ROUTINES WITH THE LEZ ROUTINES. 


CHARACTER TITLE*80 , IAXLBL*80 ,DAXLBL*80 


REAL FREQ(IOO) ,P0WER(100) , INDMIN, INDMAX 
DATA (POWER(I),I=1 ,76)/ 


+ 7066.0770323, 

+ 23314.47811626, 
+ 6533.280733426, 
+ 1075.542233512, 
+ 990.5827153465, 
+ 185.9121866205, 
+ 90151 .05656181 , 
+ 191 39.27829711 , 
+ 2769.064915013, 
+ 224.6112529072, 
+ 763.2538952391 , 
+ 1546.468077257, 
+ 46517.56984878, 
+ 67.7501808438, 

+ 643.2165902202, 
+ 8240.202957789, 
+ 780.321551955, 

+ 13314.08558278, 
+ 8369.70034301 , 


313987.5856597, 
16222.72126064, 
6567.484820724, 
2304.552081512, 
1139.692923046, 
6922.275564162, 
32565.81919631 , 
2631 1 .51279586, 
1 114.906853713, 
292.8078714839, 
1036.757022708, 
30998.79018191 , 
8264.407149583, 
1 36.6466583528, 
1824.921600301 , 
4042.516486596, 
869.238071 2535, 
42705.82833591 , 
423.4410260173, 


23005.34014683, 

11123.46224798, 

5931 .92717933, 

3938.878376374, 

539.1035104119, 

47871 .80671708, 

3126.25995372, 

18051 .10302768, 

472.3435990609, 

913.1650006148, 

2318.840862193, 

90446.39960755, 

477.4873134733, 

197.6147132091 , 

5246.018888617, 

1615.454279283, 

806 . 9102907816 , 

56933.22987158, 

1721 .308093883, 


DATA ( POWER (I) ,1=77,100)/ 

+ 3096.896818539, 1130.33337685, 

+ 496.8216394068, 716.3789266813, 
+ 185.9595078555, 349.7278623283, 
+ 339.4866401359, 404.7726592585, 
+ 168132.2764905, 259620.2781873, 
+4701.338454798, 220.74733211, 


351 .6629052997, 

707.1830537755, 

579.1 256929328, 

3303.494231505, 

179647.069922, 

377.2257021375, 


25971 .13637497, 

8573.673551723, 

3100.1 85764845, 

2372.668800947, 

186.2399260743, 

101610.8109471 , 

5378.883275207, 

7595.925085295, 

336.5553643497, 

111 1 .290988571 , 

1815.1 15702427, 

99542.65318885, 

82.183079214, 

229.3505457034, 

9355.942325835, 

876.7523693048, 

1 417 .485863451 , 

34522.64829539, 

3815.021552281/ 

323.9146852672, 

395.452882063, 

427.7957796537, 

44732.3344563, 

51634.19154093, 

552.6383507909/ 


CONVERT DATA TO BE REPRESENTED AS LOGARITHMIC 
DO 1 1=1 ,100 
FREQ( I ) =LOG1 0 ( REAL ( I) ) 

POWER ( I ) =LOG1 0 ( POWER ( I) ) 


INITIALIZE GRAPHICS PACKAGE, THEN INITIALIZE AND SELECT DISPLAY DEVICE. 
IDEV=0 

CALL LEZINI ( IDEV) 


SET LEZ ATTRIBUTES 
NVALS=1 00 

TITLE= 1 P [ BLC ] OWER LEVEL VS. FREQUENCY 1 
I AXLBL= 1 F ( BLC ] REQUENC Y , [ ELC ] H [ BLC ] Z 1 

DAXLBL=’P[ BLC] OWER LEVEL 1 
INDMIN=LOG1 0 ( 1 . ) 

INDMAX=LOG1 0(100.0) 

DEPMIN=LOG1 0(65.0) 

DEPMAX=LOG1 0 ( 290000 . 0 ) 

IAXTYP=3 

IHL0GI=0 


B - 94 



no o onoo oo o oooo oo 


IVLOGI=0 

INDHV=1 

LINAPP=1 


CALL LEZLOG (SET LEZ LOG ATTRIBUTES) 

CALL LEZLOG ( FREQ, POWER , NVALS , TITLE , IAXLBL , DAXLBL, INDMIN, INDMAX , 
+DEPMIN , D EPMAX , I AXTYP , IHLOGI , IVLOGI , INDHV, LINAPP ) 

OUTPUT A NOTE ON THE DISPLAY DEVICE 
CALL LEZNOT ( 'CDLL1 ' , 7 . , 0 . , 3 , 1 , 0 ) 


USE LOW-LEVEL ROUTINES TO ADD EXTRA AXES. 

SET WINDOW AND VIEWPORT TO MATCH LEZ'S DEFAULTS. 
CALL JWINDO (0.,7.,0.,7.) 

CALL JVPORT (-1.,1.,-1.,1.) 

GET CURRENT LEZ AXES VALUES 

CALL LEZGET( ' XORIGIN XOR, NVALS ,MVALS ) 

CALL LEZGET( 1 HAXLEN 1 , XLEN, NVALS , MVALS ) 

CALL LEZGET( ' YORIGIN' ,YOR, NVALS, MVALS) 

CALL LEZGET( ' VAXLEN 1 ,YLEN, NVALS, MVALS) 

CALL JOPEN 
HORIZONTAL AXIS 

CALL JMOVE( XOR , YOR+YLEN) 

SEE INDMIN, INDMAX ABOVE FOR THE FOLLOWING VALUES 
CALL CEXP(1 .,100.,MINH,MAXH) 

NTICH= ( MAXH-MINH ) + 1 
CALL CHLABJ ( 1 ) 

CALL CHLOGS ( MINH ) 

CALL CHLOGF( 1 ) 

CALL CHLOG ( XLEN , NTICH , 0 ) 

RESTORE VALUES FOR LEZ ROUTINES 
CALL CHLABJ ( 0 ) 


VERTICAL AXIS 

CALL JMOVE ( XOR+XLEN , YOR ) 

SEE DEPMIN ,DEPMAX ABOVE FOR THE FOLLOWING VALUES 
CALL CEXP(65.0, 290000. 0,MINV,MAXV) 

NTICV= ( MAXV-MINV ) +1 
CALL CVLABJ ( 1 ) 

CALL CVLOGS ( MINV ) 

CALL CVLOGF ( 1 ) 

CALL CVLOG ( YLEN , NTICV , 0 ) 

RESTORE VALUES FOR LEZ ROUTINES 
CALL CVLABJ ( 0) 

CALL JCLOSE 


GENERATE GRAPHICS OUTPUT FOR THE LEZ ROUTINES 
CALL LEZSHW 
C TERMINATE ALL GRAPHICS 
CALL LEZTRM 

C 

STOP 

END 


B - 95 



Power level 



o o no-* on 


PROGRAM CDLL2 


C 

C PROGRAM INTERFACING THE LOW-LEVEL ROUTINES WITH THE LEZ ROUTINES. 
C 


CHARACTER TITLE*80 , IAXLBL*80 ,DAXLBL*80 
REAL FREQ( 100), POWER( 1 00) , INDMIN, INDMAX 
DATA ( POWER ( I ) , 1=1 , 76 ) / 


+ 7066.0770323, 

+ 23314.47811626, 
+ 6533.280733426, 
+ 1075.542233512, 
+ 990.5827153465, 
+ 185.9121866205, 
+ 90151 .05656181 , 
+ 19139.2782971 1 , 
+ 2769.064915013, 
+ 224.6112529072, 
+ 763.2538952391, 
+ 1546.468077257, 
+ 46517.56984878, 
+ 67.7501808438, 

+ 643.2165902202, 
+ 8240.202957789, 
+ 780.321551955, 

+ 13314.08558278, 
+ 8369.70034301 , 


313987.5856597, 
16222.72126064, 
6567.484820724, 
2304.552081512, 
1139.692923046, 
6922.275564162, 
32565.81919631 , 
2631 1 .51279586, 
1 114.906853713, 
292.8078714839, 
1036.757022708, 
30998.79018191 , 
8264.407149583, 
136.6466583528, 
1824.921600301 , 
4042.516486596, 
869.2380712535, 
42705.82833591 , 
423.4410260173, 


DATA ( POWER ( I ) , 1=77 , 100)/ 


+ 3096.896818539, 
+ 496.8216394068, 
+ 185.9595078555, 
+ 339.4866401359, 
+ 168132.2764905, 
+ 4701 .338454798, 


1130.33337685, 

716.3789266813, 

349.7278623283, 

404.7726592585, 

259620.2781873, 

220.7473321 1 , 


23005.34014683, 

11123.46224798, 

5931 .92717933, 

3938.878376374, 

539.1035104119, 

47871 .80671708, 

3126.25985372, 

18051 .10302768, 

472.3435990609, 

913.1650006148, 

2318.840862193, 

90446.39960755, 

477.4873134733, 

197.6147132091 , 

5246.018888617, 

1615.454279283, 

806.9102907816, 

56933.22987158, 

1721 .308093883, 

351 .6629052997, 

707.1830537755, 

579.1256929328, 

3303.494231505, 

179647.069922, 

377.2257021 375, 


25971 .1 3637497, 

8573.673551723, 

3100.185764845, 

2372.668800947, 

186.2399260743, 

101610.8109471 , 

5378.883275207, 

7595.925085295, 

336.5553643497, 

1111.290988571 , 

1815.1 15702427, 

99542.65318885, 

82.183079214, 

229.3505457034, 

9355.942325835, 

876.7523693048, 

1417.485863451 , 

34522.64829539, 

3815.021552281/ 

323.9146852672, 

395.452882063, 

427.7957796537, 

44732.3344563, 

51634.19154093, 

552.6383507909/ 


CONVERT DATA TO BE REPRESENTED AS LOGARITHMIC 
DO 1 1=1,100 
FREQ( I ) =LOG1 0 ( REAL ( I ) ) 

POWER( I)=LOG1 0(POWER( I) ) 


INITIALIZE GRAPHICS PACKAGE, THEN INITIALIZE AND SELECT DISPLAY DEVICE. 
IDEV=0 

CALL LEZINI ( IDEV) 


SET LEZ ATTRIBUTES 
NVALS=1 00 

TITLE= 1 P [ BLC ] OW ER LEVEL VS. FREQUENCY’ 
I AXLBL= ' F ( BLC ] REQUENC Y , [ ELC ] H [ BLC ] Z ' 

DAXLBL= ' P [ BLC ] OWER LEVEL' 

INDMIN=LOG1 0(1 . ) 

I NDMAX=LOG 1 0(100.0) 

DEPMIN=LOG1 0(65.0) 

DEPMAX=LOG1 0 ( 290000 . 0 ) 

IAXTYP=3 

IHLOGI=0 


B - 97 


no n noon no o noon on 


IVLOGI=0 

INDHV=1 

LINAPP=1 

C 

C CALL LEZLOG (SET LEZ LOG ATTRIBUTES) 

CALL LEZLOG ( FREQ, POWER, NVALS, TITLE, I AXLBL,DAXLBL, INDMIN, INDMAX, 
+DEPMIN , DEPMAX, IAXTYP , IHLOGI , IVLOGI f INDHV,LINAPP ) 

C OUTPUT A NOTE ON THE DISPLAY DEVICE 
CALL LEZNOT( 'CDLL2' ,7.,0.,3,1 ,0) 


SUPPRESS THE LEZ DEFAULTS OF PAUSE AND CLEAR 
CALL LEZOPT( ’PAUSE’ , .FALSE. ) 

CALL LEZOPT( 'CLEAR' , .FALSE. ) 

GENERATE GRAPHICS OUTPUT FOR THE LEZ ROUTINES 
CALL LEZSHW 


USE LOW-LEVEL ROUTINES TO ADD EXTRA AXES. 

SET WINDOW AND VIEWPORT TO MATCH LEZ'S DEFAULTS. 
CALL JWINDO (0.,7.,0.,7.) 

CALL JVPORT (-1 .,1 .,-1 .,1 .) 

GET CURRENT LEZ AXES VALUES 

CALL LEZGET( 'XORIGIN' , XOR , NVALS , MVALS ) 

CALL LEZGET( ' HAXLEN ' , XLEN , NVALS , MVALS ) 

CALL LEZGET( 1 YORIGIN' ,YOR, NVALS, MVALS) 

CALL LEZGET( ' VAXLEN ' ,YLEN, NVALS, MVALS) 

CALL JOPEN 
HORIZONTAL AXIS 

CALL JMOVE ( XOR , YOR-t-YLEN ) 

SEE INDMIN, INDMAX ABOVE FOR THE FOLLOWING VALUES 
CALL CEXP(1 .,100.,MINH,MAXH) 

NTICH= ( MAXH-MINH) +1 
CALL CHLABJ ( 1 ) 

CALL CHLOGS(MINH) 

CALL CHLOGF ( 1 ) 

CALL CHLOG( XLEN ,NTICH, 0 ) 

RESTORE VALUES FOR LEZ ROUTINES 
CALL CHLABJ(O) 


VERTICAL AXIS 

CALL JMOVE (XOR+ XLEN, YOR) 

SEE DEPMIN, DEPMAX ABOVE FOR THE FOLLOWING VALUES 
CALL CEXP (6 5.0, 290000. 0,MINV,MAXV) 

NTICV= ( MAXV-MINV ) +1 
CALL CVLABJ ( 1 ) 

CALL CVLOGS ( MINV ) 

CALL CVLOGF ( 1 ) 

CALL CVLOG ( YLEN , NTICV , 0 ) 

RESTORE VALUES FOR LEZ ROUTINES 
CALL CVLABJ ( 0) 

CALL JCLOSE 


NOW PAUSE AND CLEAR 

IF(IDEV.GE.1 )CALL JPAUSE( 1 ) 
CALL J FRAME 


B - 98 



c 

C TERMINATE ALL GRAPHICS 
CALL LEZTRM 

c 

STOP 

END 


B - 99 


Power level 



Power level vs. frequency 


CDLL3 


Figure CDLL3. Program interfacing the low-level routines with the 
LEZ Routines (this program is CDLL1 modified to 
CALL CLGRID(log-log)). 


B - 100 


on n o -* o o 


PROGRAM CDLL3 


C 


C PROGRAM INTERFACING THE LOW-LEVEL ROUTINES WITH THE LEZ ROUTINES. 
C NOTE: THIS PROGRAM IS CDLL1 MODIFIED TO CALL CLGRID (LOG-LOG). 

C 


+ 

+ 

+ 

+ 

+ 

+ 

+ 

+ 

+ 

+ 

+ 

+ 

+ 

+ 

+ 

+ 

+ 

+ 

+ 

+ 

+ 

+ 

+ 

+ 


CHARACTER TITLE*80, IAXLBL*80 ,DAXLBL*80 


REAL FREQ( 100) ,P< 
DATA BLANK/0 • , 0 . 
DATA (POWER (I), I 
7066.0770323, 
23314.47811626, 
6533.280733426, 
1075.542233512, 
990.5827153465, 
185.9121866205, 
901 51 .05656181 , 
191 39.2782971 1 , 
2769.064915013, 
224.61 1 2529072, 
763.2538952391 , 
1546.468077257, 
46517.56984878, 
67.7501808438, 
643.2165902202, 
8240.202957789, 
780.321551955, 

1 331 4.08558278, 
8369.70034301 , 
DATA (POWER (I), I: 
3096.896818539, 
496.8216394068, 
185.9595078555, 
339.4866401359, 
168132.2764905, 
4701 .338454798, 


>WER ( 1 00 ) , INDMIN 

0 ., 0 ./ 

'1 ,76)/ 

313987.5856597, 

16222.72126064, 

6567.484820724, 

2304.552081512, 

1139.692923046, 

6922.275564162, 

32565.81919631 , 

26311 .51279586, 

1 114.906853713, 

292.8078714839, 

1036.757022708, 

30998.79018191 , 

8264.407149583, 

1 36.6466583528, 

1824.921600301 , 

4042.516486596, 

869.2380712535, 

42705.82833591 , 

423.44102601 73, 

77,100)/ 

1130.33337685, 

716.3789266813, 

349.7278623283, 

404.7726592585, 

259620.2781873, 

220.7473321 1 , 


INDMAX, BLANK ( 4) 


23005.34014683, 

11123.46224798, 

5931 .92717933, 

3938.878376374, 

539.10351041 19, 

47871 .80671708, 

31 26.25985372, 

18051 .10302768, 

472.3435990609, 

91 3.1650006148, 

2318.840862193, 

90446.39960755, 

477.4873134733, 

197.6147132091 , 

5246.018888617, 

1615.454279283, 

806.9102907816, 

56933.22987158, 

1721 .308093883, 

351 .6629052997, 

707.1830537755, 

579.1 256929328, 

3303.494231505, 

179647.069922, 

377.2257021375, 


25971 .1 3637497, 

8573.673551723, 

3100.1 85764845, 

2372.668800947, 

186.2399260743, 

101610.8109471 , 

5378.883275207, 

7595.925085295, 

336.5553643497, 

1111 .290988571 , 

1815.1 15702427, 

99542.65318885, 

82.1 83079214, 

229.3505457034, 

9355.942325835, 

876.7523693048, 

1417.485863451 , 

34522.64829539, 

3815.021 552281/ 

323.9146852672, 

395.452882063, 

427.7957796537, 

44732.3344563, 

51634.19154093, 

552.6383507909/ 


CONVERT DATA TO BE REPRESENTED AS LOGARITHMIC 
DO 1 1=1 ,100 
FREQ ( I ) =LOG 1 0 ( REAL ( I ) ) 

POWER ( I ) =LOG1 0 ( POWER ( I) ) 


INITIALIZE GRAPHICS PACKAGE, THEN INITIALIZE AND SELECT DISPLAY DEVICE. 
IDEV=0 

CALL LEZINI ( IDEV ) 


SET LEZ ATTRIBUTES 
NVALS=1 00 

TITLE= 1 P [ BLC ] OWER LEVEL VS. FREQUENCY 1 
I AXLBL= 1 F [ BLC ] REQUENCY, [ ELC ] H [ BLC ] Z 1 
DAXLBL='P[ BLC] OWER LEVEL* 

INDMI N=LOG 10(1 . ) 

INDMAX=LOG1 0(1 00.0) 

DEPMIN=LOG1 0(65.0) 

DEPMAX=LOG1 0 ( 290000 . 0 ) 


B 


101 



non non 


IAXTYP=3 

IHL0GI=0 

IVXi0GI=0 

INDHV=,1 

LINAPP=1 

C 

C CALL LEZLOG (SET LEZ LOG ATTRIBUTES) 

CALL LEZLOG( FREQ, POWER, NVALS, TITLE, IAXLBL, DAXLBL , INDMIN, INDMAX, 
+DEPMIN , DEPMAX, IAXTYP , IHLOGI , IVLOGI , INDHV , LINAPP ) 

C OUTPUT A NOTE ON THE DISPLAY DEVICE 
CALL LEZNOT( 1 CDLL3 1 ,7. ,0., 3, 1,0) 

C 

C USE LOW-LEVEL ROUTINES TO ADD EXTRA AXES. 

C SET WINDOW AND VIEWPORT TO MATCH LEZ'S DEFAULTS. 

CALL JWINDO(0. ,7. ,0. ,7. ) 

CALL JVPORT (-1 .,1 .,-1 .,1 .) 

C GET CURRENT LEZ AXES VALUES 

CALL LEZGETt 'XORIGIN* , XOR, NVALS, MV ALS) 

CALL LEZGET( * HAXLEN ' , XLEN , NVALS , MVALS ) 

CALL LEZGET( ' YORIGIN ', YOR, NVALS , MVALS ) 

CALL LEZGET( 'VAXLEN* , YLEN , NVALS , MVALS ) 

CALL JOPEN 
C HORIZONTAL AXIS 

CALL JMOVE( XOR,YOR+YLEN) 

C SEE INDMIN, INDMAX ABOVE FOR THE FOLLOWING VALUES 
CALL CEXP(1 . ,1 00. ,MINH,MAXH) 

NTICH= ( MAXH-MINH) + 1 
CALL CHLABJ ( 1 ) 

CALL CHLOGS ( MINH ) 

CALL CHLOGF(1 ) 

CALL CHLOG(XLEN,NTICH, 0) 

C RESTORE VALUES FOR LEZ ROUTINES 
CALL CHLABJ ( 0 ) 


VERTICAL AXIS 

CALL JMOVE(XOR+ XLEN, YOR) 

SEE DEPMIN, DEPMAX ABOVE FOR THE FOLLOWING VALUES 
CALL CEXP(65.0, 290000. 0,MINV,MAXV) 

NTICV= ( MAXV-MI N V ) + 1 
CALL CVLABJ ( 1 ) 

CALL CVLOGS ( M I NV ) 

CALL CVLOGF ( 1 ) 

CALL CVLOG ( YLEN , NTICV, 0 ) 

RESTORE VALUES FOR LEZ ROUTINES 
CALL CVLABJ(O) 


CALL CLGRID 

CALL JMOVE( XOR, YOR) 
IXC=NTICH~1 
IYC=NTICV- 1 
XSC=XLEN/REAL ( I XC ) 
YSC=YLEN/REAL ( I YC ) 
XGS=1 . 

YGS=1 . 


B - 102 



o n 


XG 1=1 . 

YGI=1 . 

NBLANK^I 

CALL CLGRID ( XSC , YSC , IXC , IYC, XGS , YGS , XGI , YGI , BLANK, N BLANK ) 
CALL JCLOSE 


GENERATE GRAPHICS OUTPUT FOR THE LEZ ROUTINES 
CALL LEZSHW 
C TERMINATE ALL GRAPHICS 
CALL LEZTRM 

C 

STOP 

END 


B 


103 



Siii 


■mi 


ml 




mm 


Frequency, Hz 


Power level vs. frequency 


Fiaure CDLL4. Program interfacing the low-level routines with the 
LEZ Routines (this program is CDLL3 modified to 
CALL CLGRID(semi-log)). 


© 




no no-* no 


PROGRAM CDLL4 


C 

C PROGRAM INTERFACING THE LOW-LEVEL ROUTINES WITH THE LEZ ROUTINES. 

C NOTE: THIS PROGRAM IS CDLL3 MODIFIED TO CALL CLGRID (SEMI-LOG). 

C 

CHARACTER TITLE*80,IAXLBL*80,DAXLBL*80 

REAL FREQ(IOO) ,POWER( 1 00 ) , INDMIN , INDMAX, BLANK(4) 

DATA BLANK/0. ,0. ,0. ,0./ 

DATA ( POWER ( I ) , 1= 1 ,76)/ 

+ 7066.0770323, 313987.5856597, 23005.34014683, 25971.13637497, 

+ 23314.47811626, 16222.72126064, 11123.46224798, 8573.673551723, 
+ 6533.280733426, 6567.484820724, 5931.92717933, 3100.185764845, 

+ 1075.542233512, 2304.552081512, 3938.878376374, 2372.668800947, 
+ 990.5827153465, 1139.692923046, 539.1035104119, 186.2399260743, 
+ 185.9121866205, 6922.275564162, 47871.80671708, 101610.8109471, 
+90151.05656181, 32565.81919631, 3126.25985372, 5378.883275207, 

+ 19139.27829711, 26311.51279586, 18051.10302768, 7595.925085295, 
+ 2769.064915013, 1114.906853713, 472.3435990609, 336.5553643497, 
+224.6112529072, 292.8078714839, 913.1650006148, 1111.290988571, 
+763.2538952391, 1036.757022708, 2318.840862193, 1815.115702427, 
+ 1546.468077257, 30998.79018191, 90446.39960755, 99542.65318885, 
+ 46517.56984878, 8264.407149583, 477.4873134733, 82.183079214, 

+ 67.7501808438, 136.6466583528, 197.6147132091, 229.3505457034, 

+ 643.2165902202, 1824.921600301, 5246.018888617, 9355.942325835, 
+ 8240.202957789, 4042.516486596, 1615.454279283, 876.7523693048, 
+ 780.321551955, 869.2380712535, 806.9102907816, 1417.485863451, 

+ 13314.08558278, 42705.82833591, 56933.22987158, 34522.64829539, 
+ 8369.70034301, 423.4410260173, 1721.308093883, 3815.021552281/ 

DATA (POWER(I) ,1=77,100)/ 

+ 3096.896818539, 1130.33337685, 351.6629052997, 323.9146852672, 

+ 496.8216394068, 716.3789266813, 707.1830537755, 395.452882063, 

+ 185.9595078555, 349.7278623283, 579.1256929328, 427.7957796537, 
+ 339.4866401359, 404.7726592585, 3303.494231505, 44732.3344563, 

+ 168132.2764905, 259620.2781873, 179647.069922, 51634.19154093, 

+ 4701.338454798, 220.74733211, 377.2257021375, 552.6383507909/ 


CONVERT DATA TO BE REPRESENTED AS LOGARITHMIC 
DO 1 I=*1 ,100 
FREQ(I)=LOG10(REAL(I) ) 

POWER ( I ) =LOG1 0 ( POWER ( I ) ) 


INITIALIZE GRAPHICS PACKAGE, THEN INITIALIZE AND SELECT DISPLAY DEVICE. 
IDEV=0 

CALL LEZINI(IDEV) 


SET LEZ ATTRIBUTES 
NVALS=1 00 

TITLE= ' P ( BLC ] OWER LEVEL VS. FREQUENCY' 
I AXLBL= ' F ( BLC ] REQUENC Y , ( ELC ] H [ BLC ) Z * 

DAXLBL= ' P [ BLC } OWER LEVEL ' 

INDMIN=LOG1 0(1 .) 

INDMAX =LOG1 0(100.0) 

DEPMIN=LOG1 0(65.0) 

DEPMAX=LOG1 0 ( 290000 . 0 ) 


B 


105 


non oooo on n noon oo 


IAXTYP= 3 

IHLOGI=0 

IVLOGI=0 

INDHV=1 

LINAPP=1 


CALL LEZLOG (SET LEZ LOG ATTRIBUTES) 

CALL LEZLOG ( FREQ , POWER , NVALS , TITLE , I AXLBL , DAXLBL , INDMIN , INDMAX , 
+DEPMIN , DEPMAX , IAXTYP , IHLOGI , IVLOGI , INDHV,LINAPP ) 

OUTPUT A NOTE ON THE DISPLAY DEVICE 
CALL LEZNOT( 'CDL5E4' ,7. ,0. ,3,1 ,0) 


USE LOW-LEVEL ROUTINES TO ADD EXTRA AXES. 

SET WINDOW AND VIEWPORT TO MATCH LEZ'S DEFAULTS. 
CALL JWINDO(0. ,7. ,0. ,7.) 

CALL JVPORT (-1.,1.,-1.,1.) 

GET CURRENT LEZ AXES VALUES 

CALL LEZGET( ' XORIGI N ' , XOR , NVALS , MVALS ) 

CALL LEZGET( ' HAXLEN ' , XLEN , NVALS , MVALS ) 

CALL LEZGET( ' YORIGIN ', YOR, NVALS , MVALS ) 

CALL LEZGET( ' VAXLEN ' ,YLEN, NVALS, MVALS) 

CALL JOPEN 
HORIZONTAL AXIS 

CALL JMOVE ( XOR , Y OR+ YLEN ) 

SEE INDMIN , INDMAX ABOVE FOR THE FOLLOWING VALUES 
CALL CEXP(1 .,100.,MINH,MAXH) 

NTICH= ( MAXH-MINH ) +1 
CALL CHLABJ ( 1 ) 

CALL CHLOGS(MINH) 

CALL CHLOGF ( 1 ) 

CALL CHLOG ( XLEN , NTICH , 0 ) 

RESTORE VALUES FOR LEZ ROUTINES 
CALL CHLABJ ( 0 ) 


VERTICAL AXIS 

CALL JMOVE (XOR+XLEN, YOR) 

SEE DEPMIN, DEPMAX ABOVE FOR THE FOLLOWING VALUES 
CALL CEXP(65.0, 290000. 0,MINV,MAXV) 

NTICV= ( MAXV-MINV) +1 
CALL CVLABJ ( 1 ) 

CALL CVLOGS(MINV) 

CALL CVLOGF ( 1 ) 

CALL CVLOG ( YLEN , NTICV , 0 ) 

RESTORE VALUES FOR LEZ ROUTINES 
CALL CVLABJ(O) 


CALL CLGRID 

CALL JMOVE (XOR, YOR) 
IXC=-1 
IYC=NTICV- 1 
XSC=XLEN 

YSC=YLEN/REAL( IYC ) 
XGS=0. 

YGS=1 . 


B - 106 


o n 


XGI=XLEN/REAL ( NTICH- 1 ) 

YGI=1 . 

NBLANK=1 

CALL CLGRID ( XSC , YSC , I XC , I YC , XGS , YGS , XGI , YGI , BLANK, N BLANK) 
CALL JCLOSE 


GENERATE GRAPHICS OUTPUT FOR THE LEZ ROUTINES 
CALL LEZSHW 
C TERMINATE ALL GRAPHICS 
CALL LEZTRM 

C 

STpP 

END 


B - 107 



Appendix C 

A List of DI-3000 Routines 


This appendix provides a list of DI-3000 routines, and a one line description of their 
purpose. The contents of this appendix was obtained from PVI's DI-3000 User's 
Guide [G-5]. 

Chapter 3 Functional Descriptions Chapter 3 


3.1B DI-3000 

SUBROUTINE 

SUMMARY 


Listed below are all the DI-3000 subroutines grouped by function. Some subrou- 
tines appear in more than one place to show all their functional groupings. The 
functions of these subroutines have been discussed in the preceding sections of 
Chapter 3. Each individual subroutine is completely described in Appendix A of 
this User’s Guide. Subroutines marked [E] are part of DI-3000 Extended; 
those marked [M] are part of the Metafile System. Both are options to DI-3000 
and may not be available at all installations. 


3.18.1 SYSTEM 

JBEGIN 

Initialize DI-3000 

AND DEVICE 

JEND 

Terminate DI-3000 

CONTROL 

JDINIT 

Initialize a device 

JDEVON 

Select a device 


JDEVOF 

Deselect a device 


JDEND 

Terminate a device 


3.18.2 DRAWING 

JMOVE 

Invoke an absolute, 2D move 

PRIMITIVES 

JRMOVE 

Invoke a relative, 2D move 


J3MOVE 

Invoke an absolute. 3D move 


JR3MOV 

Invoke a relative, 3D move 


JDRAW 

Invoke an absolute, 2D draw 


JRDRAW 

Invoke a relative, 2D draw 


J3DRAW 

Invoke an absolute, 3D draw 


JR3DRA 

Invoke a relative, 3D draw 


JPOLY 

Draw an absolute, 2D polyline 


JRPOLY 

Draw a relative. 2D polyline 


J3POLY 

Draw an absolute, 3D polyline 


JR3PLY 

Draw a relative, 3D polyline 


JMARK 

Draw an absolute, 2D marker 


JRMARK 

Draw a relative, 2D marker 


J3MARK 

Draw an absolute. 3D marker 


JR3MRK 

Draw a relative, 3D marker 


JPMARK 

Draw- an absolute, 2D polymarker 


JPRMRK 

Draw a relative, 2D polymarker 


JP3MRK 

Draw an absolute, 3D polymarker 


JPR3MR 

Draw a relative, 3D polymarker 


JPOLGN 

Draw* an absolute, 2D polygon 


JRPLGN 

Draw a relative, 2D polygon 


J3PLGN 

Draw an absolute. 3D polygon 


JR3PGN 

Draw a relative, 3D polygon 


JRECT 

Draw an absolute rectangle 


JRRECT 

Draw' a relative rectangle 


JCIRCL 

Draw a circle 


JSECTR 

Draw a sector 


JARC 

Draw an arc 


JF2PLN 

Generate a “smoothed" polyline 

3.18.3 PRIMITIVE 

JCOLOR 

Set the current color 

ATTRIBUTES 

JDCOLR 

Set the default color 


JINTEN 

Set the current intensity 


JDINTE 

Set the default intensity 


C- 1 



Chapter 3 


Functional Descriptions 


Chapter 3 


3.18.4 TEXT 
PRIMITIVES AND 
ATTRIBUTES 


JLSTYL 

Set the current linestyle 

JDLSTY 

Set the default linestyle 

JLWIDE 

Set the current linewidth 

JDLWID 

Set the default linewidth 

JPEN 

Set the current pen 

JDPEN 

Set the default pen 

JPEDGE 

Set the current polygon edge style 

JDPEDG 

Set the default polygon edge style 

JPFSIM 

Set the polygon fill simulation mode 

JPINTR 

Set the current polygon interior style 

JDPINT 

Set the default polygon interior style 

JPIDEX 

Set the current polygon interior color and intensity 

JDPIDX 

Set the default polygon interior color and intensity 

JCMARK 

Set the current marker symbol 

JDMARK 

Set the default marker symbol 

JATTRB 

Set any current primitive attribute 

JDATTR 

Set any default primitive attribute 

JASAVE 

Save all current primitive attribute values 

JALOAD 

Load previously saved primitive attribute values 

JARSET 

Reset all current attributes to default values 


Text output primitives: 


J1TEXT 

J1STRG 

J2TEXT 

J2STRG 

J3TEXT 

J3STRG 

JHTEXT 

JHSTRG 


Output string precision text (FORTRAN 66) 
Output string precision text (FORTRAN 77) 
Output character precision text (FORTRAN 66) 
Output character precision text (FORTRAN 77) 
Output stroke precision text (FORTRAN 66) 
Output stroke precision text (FORTRAN 77) 
Output graphic arts precision text (FORTRAN 66) 
Output graphic arts precision text (FORTRAN 77) 


Text attributes: 


JPATH 

Set the current character path 

JDPATH 

Set the default character path 

JFONT 

Set the current character font 

JDFONT 

Set the default character font 

JJUST 

Set the current text justification 

JDJUST 

Set the default text justification 

JSIZE 

Set the current character size 

JDSIZE 

Set the default character size 

JGAP 

Set the current character gap 

JDGAP 

Set the default character gap 

JBASE 

Set the current character base line 

JDBASE 

Set the default character base line 

JPLANE 

Set the current character plane 

JDPLAN 

Set the default character plane 

JCESUB 

Set the current size and position of subscripts 

JDESUB 

Set the default size and position of subscripts 

JCESUP 

Set the current size and position of superscripts 

JDESUP 

Set the default size and position of superscripts 

JCEFLG 

Set the current sentinel character flags (FORTRAN 66) 


C- 2 



Chapter 3 


Functional Descriptions 


Chapter 3 


3.18.5 SEGMENTS 
AND SEGMENT 
ATTRIBUTES 


JDEFLG Set the default sentinel character flajrs (FORTRAN 66) 

JSCEFL Set the current sentinel character flags (FORTRAN 77) 

JSDEFL Set the default sentinel character flags (FORTRAN 77) 


Text positioning and text inquiry: 


JCRLF 

JMARGN 

JEXTNT 

JSTXTN 

JHXTNT 

JHSXTN 

JIQTXT 


Generate a carriage return/line feed 
Set the character margin 

Return the string extent, stroke precision (FORTRAN 66) 
Return the string extent, stroke precision (FORTRAN 77) 
Return the string extent, graphic arts precision 
(FORTRAN 66) 

Return the string extent, graphic arts precision 
(FORTRAN 77) 

Return the hardware text character size 


Segment creation: 

JOPEN Open a temporary segment 

JCLOSE Close a temporary segment 

JROPENfE] Open a retained segment 

JRCLOS[E] Close a retained segment 


Segment attributes: 


JTTYPE[E] 

JVISBLfE] 

JDVISB[E] 

JVSALLfE] 

JHILIT[E] 

JDHILI[E] 

JDETEC[E] 

JDDETE[E] 

JSGPRI[E] 

JDSGPR[E] 

JPKID[E] 

JDPKIDfE] 


Define a global image transformation type 
Set the visibility of a retained segment 
Set the default visibility of subsequent retained segments 
Set the visibility of all retained segments on all devices 
Set the highlighting of a retained segment 
Set the default highlighting of subsequent retained 
segments 

Set the detectability and PICK priority of a retained 
segment 

Set the default detectability and PICK priority of 
subsequent retained segments 
Set the segment priority of a retained segment 
Set the default segment priority for subsequently created 
segments 

Set the PICK-ID of subsequent primitives within a 
retained segment 

Set the default PICK-ID of subsequent primitives within 
a retained segment 


Segment operations: 


JRENAM[E] 

JPURGE[E] 

JCLEARIE] 

JSASSOfE] 

JSDASS[E] 

JSAALUE] 


Rename a retained segment 

Delete a retained segment 

Delete all retained segments 

Associate a retained segment with a specific device 

Disassociate a retained segment from a specific device 

Associate or disassociate all segments with a specific device 


C- 3 


Chapter 3 


Functional Descriptions 


Chapter 3 


3.18.6 SHIELDING 
REGIONS 


3.18.7 VIEWING 
TRANSFORMATIONS 


JFRAME 

JUPDAT 

JSCOPY[E] 

JSSAVEfE] 

JSREST[E] 

JSAPND[E] 

JEPSEGfE] 

JISGMTJE] 


Clear the display area and redraw all retained segments 
Flush the internal buffers to ensure a current image 
Make a copy of a retained segment 
Save the current Segment Storage to an internal save file 
Restore Segment Storage from an internal save file 
Append an internal save file to current Segment Storage 
Define a PICK list of retained segments 
Return information on a specified retained segment 


Segment image transformations: 


JT2TRA[E] 

JT2ALUE] 

JELSEG[E] 

JEVSEG[E] 

JIQ2TR[E] 

JIQ2AUE] 


Set a 2D translation image transformation for a retained 
segment 

Set a complete image transformation for a retained segment 

Associate the image transformation with a LOCATOR 
input echo 

Associate the image transformation with a VALUATOR 
input echo 

Return the 2D translation components of an image 
transformation 

Return all 2D components of an image transformation 


BATCH-OF-UPDATES: 


JBGBATfE] Begin a BATCH-OF-UPDATES 

JENBAT[E] End a BATCH-OF-UPDATES 


JSHLDW 
JSHLDV 
JSHCLP 
JSC ALL 
JIQSHL 

JIQNSH 
JSHPRG 
J SPALL 


Define a shielding region in world coordinates 
Define a shielding region in virtual coordinates 
Enable or disable shielding within a shielding region 
Enable or disable shielding within all shielding regions 
Determine if a shielding region has been defined and 
return the shielding status and coordinates 
List the identifiers of all currently defined shielding regions 
Delete a shielding region 
Delete all shielding regions 


JWINDO 

JVPORT 

JVUPNT 

JNORML 

JVUPLN 

JUPVEC 

JPARAL 

JPAROB 

JPERSP 

JPEROB 

JCVIEW 


Define the viewing window 
Define the viewport 
Define the view reference point 
Define the viewplane normal 
Define the viewplane distance 
Define the viewup vector 
Set the projection to parallel 
Set the projection to parallel oblique 
Set the projection to perspective 
Set the projection to perspective oblique 
Define a viewing transformation in world Cartesian 
coordinates 


C- 4 



Chapter 3 


Functional Descriptions 


Chapter 3 


JSVIEW 

JHITHR 

JYON 

JWCLIP 

JHCLIP 

JYCLIP 

JVSPAC 

JRIGHT 

JRESET 

JVSAVE 

JVLOAD 


Define a viewing transformation in world spherical 
coordinates 

Set the hither plane distance 
Set the yon plane distance 
Turn window clipping on or off 
Turn hither clipping on or off 
Turn yon clipping on or off 
Redefine the dimensions of the virtual coordinates 
Change the "handedness” of the world coordinate system 
Reset the viewing transformation to default 
Save the current viewing parameters into an array 
Replace the current viewing parameters from a previously 
saved array 


C- 5 



Chapter 3 


3.18.8 INPUT 
FUNCTIONS 


3.18.9 IMAGE 

TRANSFORMATIONS 


3.18.10 MODELING 
TRANSFORMATIONS 


3.18.11 DEVICE 
TRANSFORMATIONS 


3.18.12 SYSTEM 
AND DEVICE INQUIRY 


Functional Descriptions 


Chapter 3 


JIENAB 

JIDISA 

JBUTTN 

JLOCAT 

JVALUE 

JKEYBD 

JKEYBS 

JSTROK 

JPICK(E] 

JSPICKfE] 

JPKAPRfE] 

JCONPK[E] 

JEPSEG[E] 

JPECHO 

JELSEG[E] 

JEVSEG[E] 


Associate a physical input device with a virtual input function on 
a specific display device 

Disassociate a physical input device from a virtual input function 
on a specific display device 
Request BUTTON input 
Request LOCATOR input 
Request VALUATOR input 
Request KEYBOARD input (FORTRAN 66) 

Request KEYBOARD input (FORTRAN 77) 

Request STROKE input 
Request PICK input 
Request a software simulation of PICK 
Define the size of the PICK aperture 
Continue a PICK function 
Establish a PICK list of retained segments 
Set the echo position for subsequent input functions 
Associate the image transformation with a LOCATOR input 
echo 

Associate the image transformation with a VALUATOR input 
echo 


JTTYPE[E] 

JT2TRA[E] 

JT2ALUE] 

JELSEG[E] 

JEVSEG[E] 

JIQ2TR(E] 

JIQ2AL(E] 


Define a global image transformation type 
Set a 2D translation image transformation for a retained segment 
Set a complete image transformation for a retained segment 
Associate the image transformation with a LOCATOR input echo 
Associate the image transformation with a VALUATOR input 
echo 

Return the 2D translation components of an image transformation 
Return all 2D components of an image transformation 


JTRANS[E] 

JBUILD[E] 

JMODEL 

JMODON 

JCONCT[E] 


Define a modeling transformation matrix 
Build on an existing modeling transformation matrix 
Select a modeling matrix for subsequent primitives 
Enable or disable the current modeling matrix 
Concatenate two existing transformation matrices 


JDEVWN Define the device window 

JDEVVP Define the device viewport 


TfP 

JIQDDL 

JIQDIL 

JIQDIM 


Return the current position in world coordinates 
Return the release level of the device driver 
Return the release level of DI-3000 
Return the maximum dimensions of the display device in 
meters 


C - 6 



Chapter 3 


Functional Descriptions 


Chapter 3 


3.18.13 METAFILE 
SYSTEM 


3.18.14 ERROR 
PROCESSING AND 
DEBUGGING 


3.18.15 SPECIAL 
DEVICE FUNCTIONS 


JIQERR 

JIW1ND 

J1IGET 

J3RGET 

J4RGET 

J16GET 

JASPER 

JIQTXT 

JIQDEV 

JISGMT[E] 

JIQ2TR(E] 

JIQ2AL[E] 


Return the most recent error number detected 
Return the window location in 3D, untransformed world co- 
ordinates 

Return a single INTEGER value (e.g., a current attribute value) 
Return three floating point values (e.g., the view reference point) 
Return four floating point values (e.g., the viewport borders) 
Return a four-by-four floating point matrix defining a trans- 
formation 

Return the aspect ratio of a physical device 
Return the hardware text character size 
Return an INTEGE R characteristic of a device (e.g., the number 
of colors supported) 

Return an array of information on a particular retained segment 
Return the 2D translation components of an image transformation 
Return all 2D components of an image transformation 


JDINIT 

JDEVON 

JDEVOF 

JDEND 

JMFDAT[M] 

JMFFMT[M] 

JIQFMT[M] 

JMTEXT[M] 

JMSTRG[M] 

JMGET[M] 

JMREAD[M] 

JMINTR[M] 


Initialize the Metafile Driver 
Select the Metafile Driver 
Deselect the Metafile Driver 
Terminate the Metafile Driver 
Write a data record to the metafile 
Set the metafile format 

Inquire capability of system to determine input file format 
Write a picture title to the metafile (FORTRAN 66) 

Write a picture title to the metafile (FORTRAN 77) 
Return the current item code from the metafile 
Return the current item from the metafile 
Translate the metafile item into a DI-3000 action 


JSETER 

JSETDB 

JFILES 

JFTOPN 

JFSOPN 


Set the error fatality level 
Set the debugging commentary level 
Set the logical unit number of the error log or debug file 
Set the logical unit number and/or file name of the error log or 
debug file (FORTRAN 66) 

Set the logical unit number and/or file name of the error log or 
debug file (FORTRAN 77) 


JPAUSE 

JDD3D 

JBACKG 

JCOTBL 

JESCAP 

JIESCP 

JINESC 


Request a pause action 

Use 3D virtual coordinates at the device dependent level 
Set the background color 

Download a color table of device dependent color indices 
Invoke an output escape function 
Invoke an input escape function 

Inquire a physical device on the availability of escape functions 


C- 7 


r 


Chapter 3 


Functional Descriptions 


Chapter 3 


3.18.16 OTHER JBEAM Explicitly position the drawing beam on a device 

FUNCTIONS JFILES Set the logical unit number for several internal files 

JFTOPN Set the logical unit number and/or name for several internal files 

(FORTRAN 66) 

JFSOPN Set the logical unit number and/or name for several internal files 

(FORTRAN 77) 

JCONVW Convert virtual coordinates to world coordinates 
JCONWV Convert world coordinates to virtual coordinates 
JFRAME Clear the display surface and redraw all retained segments 
JUPDAT Flush the internal buffers to ensure that the picture is current 




C- 8 





Appendix D 


How to Access and Execute the Common Graphics Library 


This appendix explains how to access and execute the CGL on several computer 
systems. It contains the following sections: 


1 .0 Accessing the Common Graphics Library on NOS 2 

1.1 Manual Load Sequence 2 

1 .2 Batch CCL Procedure 3 

2.0 Accessing the Common Graphics Library on PRIMOS 4 

2.1 Load Sequence Using Unshared Versions of DI-3000 4 

2.2 Load Sequence Using Shared Version of DI-3000 5 

3.0 Accessing the Common Graphics Library on VAX 6 


Any FORTRAN 77 code will be able to access the CGL routines which currently use 
the DI-3000 based CGL. The CGL does not contain any PVI software: therefore, the 
device drivers, DI-3000 library, extended library, and any other DI-3000 based 
software must be loaded with the CGL. The user should consider the CGL as an 
extension of their graphics program. Because NOS and PRIME are ACD supported 
systems, procedures for these machines are given in this section. As the CGL is 
moved onto other ACD supported systems, this section will be expanded. 


D- 1 


1.0 Accessing The Common Graphics Library On NOS 


The CGL is available as a user library under the user number UN=LIBRARY. It may 
be accessed and loaded manually in a job stream or terminal session. There are 
also Cyber Control Language (CCL) procedures to facilitate both batch and 
interactive operation of the CGL. 

1.1 Manual Load Sequence 
Metafile Driver LOAD/EXECUTE Sequence (NOS) 

ATTACH,DI3000,DIERFN,MFNODE,SSDUMMY,DD4014/UN=LIBRARY. 

ATTACH, DICOMLB/UN=LIBRARY. 

LDSET,LIB=DI3000/DICOMLB,MAP=N. 

LOAD,MFNODE,SSDUMMY,DD4014. 

LGO. 


NGS LOAD/EXECUTE Sequence 

ATTACH, DI3000,DIERFN,MFDUMMY I SSDUMMY 1 DD=DD4014/UN=LIBRARY. 
ATTACH, DiCOMLB/UN=LIBRARY. 

LDSET,LIB=DI3000/DICOMLB,MAP=N. 

LOAD.MFDUMMY.SSDUMMY.DD. 

LGO. 


D- 2 



1.2 Batch CCL Procedure 


There are two batch procedures to run the CGL. The first procedure uses the 
standard NOS load sequence and is called CGLGO. The second, called CGLCGO, 
uses the capsule loader version of DI-3000. Their usage is given below: 

GET,CGLGO/UN=PVINFO. 

CGLGO, DRIVER, MF.SS, ACCOUNT. 

Where: DRIVER - the device driver to be loaded. 

MF - the metafile (omit if none is desired) 

MFNODE - if one is desired. 

SS - use the extended version of DI-3000 
ACCOUNT- ACCOUNT other than LIBRARY (not recommended 
unless a special driver is used.) 

GET,CGLCGO/UN=PVINFO. 

CGLCGO, LGO, DRIVER, MF.SS, ACCOUNT. 


Where: 


LGO 

DRIVER - 
MF 

MFNODE - 
SS 

ACCOUNT- 


the relocatables of the user’s program, 
the device driver to be loaded, 
the metafile (omit if none is desired) 
if one is desired. 

use the extended version of DI-3000 
ACCOUNT other than LIBRARY (not recommended 
unless a special device driver is used). 


D- 3 



2.0 Accessing The Common Graphics Library On PRIMOS 

The CGL is available as a user library on the PRIME network. The CGL pathname 
is: 

PVI.INFO>CGL>DICOM.LIB 

and it is located on the M machine. The user can use the load sequences below to 
build CPL files to create and execute a SEG file for a CGL application program. 
These sequences can also be performed manually. 

The following assumptions hold for all the load sequences in this section: 

1 ) application program resides on a file named TEST.F77. 

2) all programs compiled using F77 compiler (i.e., F77 TEST). 

3) target device is Tektronix 4014. 

2.1 Load Sequence Using Unshared Versions of DI-3000 

SEG -LOAD 
ST 177774 (OPTIONAL) 

LO TEST 

LO PVI.INFO>CGL>DICOM.LIB 

LI DIBASIC 

LI DD4014 

LI VAPPLB 

LI 

Q 

To execute: 

SEG TEST 


D- 4 



2.2 Load Sequence Using Shared Version of DI-3000 

SEG -LOAD 
ST 177774 (OPTIONAL) 

LO TEST 

LO PVI.INFO>CGL>DICOM.LIB 
LI D13.SHR 
LI VAPPLB 
LI 
Q 

To execute: 

SEG TEST 


All conventions for using the shared version of DI-3000 (WHOAMI, metafiles, etc.) 
remain unchanged. See Section 7.1. 4.2 of the Graphics Mini-Manual (Central 
Scientific Computing Complex Document G-1 ) for complete details. 


3.0 Accessing The Common Graphics Library On Vax 

Several VAX machines on the field have the CGL available to the users. The load 
sequence below can be used either in a .COM file or entered interactively. 

The following assumptions hold for the given load sequence: 

1) application program resides on a file of the form XXX.FOR. 

2) all programs are compiled by executing the command FOR XXX, where 
XXX is the XXX.FOR file from 1). 

3) the target device is a Tektronix 41 OX series terminal. 

The load sequence is: 

LINK ’Pr- 

Dxxx:[CGL directoryJDICOM.OLB/LIBRARY - 
Dyyy:[DI3000 directoryJDILIB.OLB/LIBRARY - 
Dyyy:[DI3000 directory]DDR405.OBJ - 
Dyyy:[DI3000 directory]MFNODE.OBJ - 
Dyyy:[DI3000 directory]DIMFLIB.OLB/LIBRARY - 
Dyyy:[DI3000 directoryjuTILUB.OLB/LIBRARY - 


where: 


•PI' 

Dxxx 

Dyyy 

CGL directory 
DI3000 directory 
DICOM.OLB 
DILIB.OLB 
DDR405.OBJ 

• MFNODE 

• DIMFLIB.OLB 
UTILLIB.OLB 


XXX from 1) and 2) above 
disk where the CGL directory resides 
disk where the DI3000 directory resides 
pathname to the CGL files 
pathname to the DI3000 files 
CGL code (executables) 

D13000 code 
device driver 
metafile device driver 

library containing I/O routines for the Metafile device driver 
library containing utility routines for DI3000 




These two files need not be included in the load sequence if the metafile is not 
used. 



NOTE : Since there is no centralized control over the different VAX machines on 
the field, the exact pathnames and filenames may be different from 
machine to machine. The system administrator for the user's machine 
should be contacted for specific directory and file information. 


D- 7 


List of References 


The following list of references are denoted by: 

G-x refers to the ACD document series. 

G-1 GRAPHICS MINI MANUAL (September 1985) 

G-2 Guidelines in Preparing Computer-Generated Plots for 

NASA Technical Reports with the LaRC Graphics Output 
System (NASA TM 81908 (revised), August 1983) 

G-3 Langley Graphics System (January 1983) 

G-5 DI-3000 User's Guide (Version 4) 

G-6 Metafile System User's Guide 

G-7 GRAFMAKER User's Guide, Precision Visuals 

Incorporated (PVI) 

G-10 Device Driver Guides 

G-1 2 Common Graphics Library (CGL) Volume I: LEZ User's 

Guide (May 1988 - Preliminary) 

NMI 1 020.1 E NASA Langley Research Center Management Manual 
(Paragraph 13b) 


R-1