Plotting

TCL API

C Routine Interface

Introduction

PGPLOT is a Fortran subroutine package for drawing simple scientific graphs on various graphics display devices. It was originally developed for use with astronomical data reduction programs in the Caltech Astronomy department.

The PGPLOT routines can be called from a C program following the rules for calling fortran routines from C. For more information about the PGPLOT available routines and calling sequence refer to the PGPLOT manual.

DERVISH defines TCL commands which call PGPLOT routines. The input to the routines follows the TCL format. Before running DERVISH the DISPLAY variable must be defined to the correct X display.

Under the $DERVISH_DIR/etc a template TCL procedure file is provided, dervishStartup.tcl, which includes definition of a procedure for plotting the contents of a row or column of a DERVISH region. This procedure is automatically incorporated by the DERVISH executable.

Note1: In all calls to PGPLOT routines, if an array is to be specified as one of the arguments then it must be defined as a TCL list.

A 1-dimensional array, a[4], will be specified as follows:

{e0 e1 e2 e3} where: the "{}" braces are part of the specification. e0, e1, e2, e3 are the values of elements a[0] a[1] a[2] a[3] respectively. A 2-dimensional array aa[3][3] should be specified as follows: {{e00 e01 e02} {e10 e11 e12} {e20 e21 e22}} where: the "{}" braces are part of the specification. e00 e01 e02 etc are the values of elements aa[0][0] aa[0][1] aa[0][2] etc respectively.

Note2: If an argument is to be a function of a variable internal to PGPLOT then that argument should be enclosed in "{}" brackets in order to avoid evaluation.

Note3: You might want to look at the documentation for vectorExprPlot, which can be used in conjunction with vectorExprPrint to plot complicated functions and arrays of floats.