*************************************************************************
*									*
*									*
*		     PLOT82 VAX/VMS PLOTTING PACKAGE			*
*									*
*	   Last Update:		October 28 1982       DAA		*
*									*
*									*
*************************************************************************


	This plotting package was designed to be compatible with the
LOW-LEVEL GRAPHICS package available on the cambridge IBM 370. A few
additional calls that are VERSATEC compatible are also provided.
	Plots are generated in 2 steps:
1) An intermediate file is set up that contains all of the BOUNDS,LINEWEIGHT,
COLOUR,etc. information as well as all of the actual pen strokes reduced
to positive integers on a 100 bits/inch grid. This file thus contains all
information required for generating a plot on any plotting device.
2) This intermediate file is processed by a plotter-specific program
to generate the plot.

	The co-ordinate system is setup with as follows with default
dimensions in mm:

 	   0,y	!
		!
		!
		!
		!
	   	!.........................
	    0,0				x,0        (X = across width of paper)
	

SECTION 0.	Differences from PLOT81
---------	-----------------------

		Although the changes primarily involve the structure of
		the intermediate plot file, two calls have been changed:

1.		CRTPLT now takes the FILENAME or LOGICALNAME of the
		intermediate file as an argument. This must be either
		a string (eg. 'PLOT.PLT') or a CHARACTER-type variable.
		A call to DOPEN is now UNNECESSARY.

2.		BRKPLT has been changed to have only 1 argument.
		If positive then more plots to follow.
		If negative then last plot.
Note:		***  It is ABSOLUTELY necessary to end with a call to
		BRKPLT with a negative argument!!!!   *************
		The absolute value of the number specifies the number
		of formfeeds between plots.
		
		
SECTION I.	GENERAL SETUP CALLS
---------       -------------------

A.		Starting & Ending plots
--		-----------------------


CRTPLT(FILENAME,MCOLOR)	
		FILENAME = LOGICAL or "true" filename for intermediate file
Note:		FILENAME is a CHARACTER-type variable

		MCOLOR = 0  either single colour or black & white plotting
		MCOLOR = 1  multiple colours being used
		Use this routine to initialize all general plotting
		parameters. 
Note:		This MUST be called before any other plot calls (with
		the exception of  ALTPRM).


BRKPLT(NFORM)
		NFORM <= 0  done plotting (MUST do at END of plotting)
		NFORM >0    finish this plot, prepare for next plot

		& will  perform IABS(NFORM) formfeeds  after plot

		Plot control parameters are left unchanged by this
		routine. To perform a complete re-initialization
		use CRTPLT

Note:	*****	When done plotting a call to BRKPLT with NFORM<0
		ABSOLUTELY MUST BE DONE!!!!!!!    *******

B.		Controlling PEN characteristics
--		-------------------------------

PEN(N)		Sets pen colour to colour N
		Default = unchanged = Blue
		N = 1	BLACK	   (YELLOW + RED + BLUE overprinted)
		N = 2	RED
		N = 3	GREEN	   (YELLOW + BLUE	overprinted)	
		N = 4	BLUE
		N = 5	YELLOW
		N = 6	ORANGE	   (YELLOW + RED	overprinted)
		N = 7	PURPLE	   (RED + BLUE		overprinted)


LINEWT(N)	Sets pen thickness to N times single lineweight
		Default = 1
		Conditions:     0 < N < 10


PAPER(X)	Moves paper X mm (in either direction)


C.		Altering PLOT Frame (Boundary & Transformations)
--		------------------------------------------------


BOUNDS(XMIN,XMAX,YMIN,YMAX)
		Sets up plotting region in user units with respect to
		current origin.
		Thus all vectors outside of a range around the current
		origin specified by XMIN...YMAX will be clipped at the
		border.
		Default:   XMIN,YMIN = 0
			   XMAX,YMAX  corespond to a plot 13" wide by 20" long


SCALE(A,B)
		A,B are the ratios of new scale values to old (X,Y) respectively
		Changes meaning of user units.
		Default:    user units in mm
		setting A,B = 25.4  would put units in inches

ROTATE(A)
		Rotates coordinate system A DEGREES ANTI-CLOCKWISE

TRANSFM(A,B,C,D)
		Resets transformation matrix (values in mm)
		Note:  call to TRANSFM will override previous SCALE,ROTATE
		X' = AX + BY
		Y' = CX + DY


ORIGIN(X,Y,N)
		Sets up new origin in user units. 
		N = 0	   Absolute
		N = 1	   Relative to old origin
		N = 2	   Relative to current pen position
		N = 3	   Relative to current character position
		Note:  translational effects of origin call occur
		AFTER any rotations


D.		Character Setup
--		---------------

ANROT(A)
		Rotate annotation angle for a string of characters
		A degrees ANTI-CLOCKWISE

ROTCHR(A)
		Rotate each character A degrees ANTI-CLOCKWISE

SCLCHR(A,B)
		Ratios of new to old character width & height

CHRSPC(A)
		Ratio of new to old character spacing

LOCCHR(X,Y,N)
		Set up character position
		N = 0	     Relative to current origin
		N = 1	     Realtive to current pen position

FONT(N)
		Select desired type font.
		N = 0	     Simple, capital-only type set
		N = 1	     Nice, block-letter type set  (default)
		N = 2	     Bold-faced italics
		N = 3	     Script
		N = 4	     Greek

IRELCH(N)
		Select relative location of character (Font .ne. 0, only)
		N = 0	     Lower left-hand corner   (default)
		N = 1	     Lower right
		N = 2	     Upper left
		N = 3	     Upper right
		N = 4	     Centered      (not for use with CSTRING!!!)



SECTION II.	LINE  & CHARACTER PLOTTING CALLS
----------	--------------------------------

DRAWTO(X,Y)
		Draws to position X,Y relative to origin

DRAWBY(X,Y)
		Draws to position X,Y relative to last pen position

MOVETO(X,Y)
		Moves to position X,Y relative to origin

MOVEBY(X,Y)
		Moves to position X,Y relative to last pen position

PLOT(X,Y,N)
		Performs DRAWTO/BY & MOVETO/BY  functions
		N = 0   DRAWTO
		N = 1   DRAWBY
		N = 2   MOVETO
		N = 3   MOVEBY

VECPLT(XVEC,YVEC,NPTS)
		Plots a string of NPTS points contained in XVEC & YVEC
		First point is done with MOVETO, rest with DRAWTO


STRING(TEXT,NCHARS)
		Plots a string of NCHARS characters from the packed vector
		TEXT  (all other parameters are controlled from above)
		Character location is automatically incremented. Thus
		successive calls to STRING will output a continuous
		line of characters.
Note:		Must NOT be used with CHARACTER-type variables!!!!!!
		Character-type strings MAY be passed using the system
		subroutine %REF()  :
		CALL STRING(%REF('Text of String'),14)


CSTRING(TEXT,NCHARS)
		Plots a string of NCHARS characters from the packed vector
		TEXT centered at the current location. All else as with
		STRING.
Note:		Must NOT be used with CHARACTER-type variables!!!!!!



SECTION III.	VERSATEC COMPATIBLE CALLS
------------	-------------------------

 
NUMBER (X,Y,HEIGHT,FPN,ANGLE,NDIG)

             (X,Y) = starting coordinates for 1st char (real)
             HEIGHT = character height (real)
             FPN = number to be converted to digits and plotted (real)
             ANGLE = angle at which numeric string is to be plotted
                     in degrees measured from the x-axis (real)
             NDIG = specification of the number of digits and the type
                    of numeric string to be plotted (integer)
                  > 0 = number of digits to the right of the decimal
                        point to be plotted (last digit is rounded)
                  = 0 = rounded integer portion of fpn is plotted
                        with a decimal point
                  = -1 = rounded integer portion of fpn is plotted
                         without the decimal point
                  < -1 = rounded integer portion of fpn is plotted
                         after having the least significant digits
                         truncated (iabs(ndec)-1 digits are truncated)

AXIS (X,Y,LABEL,NCHAR,AXLEN,ANGLE,FVAL,DV)

             (X,Y) = starting coordinates for axis generation (real)
             LABEL = alphanumeric text string for labeling the axis
             NCHAR = number of characters in the axis label (integer)
                   = + = annotations generated above axis
                   = - = annotations generated below axis
             AXLEN = axis length in inches (real)
             ANGLE = angle in degrees at which axis is drawn (real)
             FVAL = first annotation value (real)
             DV = delta annotation value (real)

Note:	Character sizes for labels can be changed using SCLCHR
Note:	Must NOT be used with CHARACTER-type variables!!!!!!


SECTION IV.	SPECIAL PLOT SETUP CALLS
-----------	------------------------

ALTPRM(NBPI,PAPWID,PAPLEN)	This is a special call to alter the
				fundamental constants used for creating plots.
				This call should be used with GREAT CAUTION.
				ANY changes of these parameters necessitates
				changes in TRILOG & TRICOLOUR!!!!!!!!
				This call MUST be made BEFORE CRTPLT is called.
					
		NBPI   =	Number of bits per inch resolution in plot file
				(default = 100)
		PAPWID =	Paper width in INCHES  (default = 13.0)
		PAPLEN =	Paper length in INCHES (default = 20.0)
				Setting a parameter to a value >900 means
				to use previous value for that parameter.



SECTION  V.	LINKING IN THE PLOT82 ROUTINES
-----------	------------------------------

	To link in the VAX/VMS PLOT82 subroutines:

PLINK MYPROGRAM,MYLIBRARIES/L        (PLINK set up in LOGIN.COM)

or

PIMLINK MYPROGRAM,MYLIBRARIES/L       as PLINK but also calls IMAGE library

or

LINK MYPROGRAM,MYLIBRARIES/L,[PUBLIC.LIB]PLOT82/L,MODLIB/L





SECTION VI.	FINAL PLOT GENERATION:  INVOKING PASS2
-----------	--------------------------------------

	There a currently 3 output routines available:
	TRILOG			(proper plots on the TRILOG printer/plotter)

	TRICOLOR		Multi-colour version of TRILOG (under development)

	VIEW			Interactive program to output plots on VT640.

	These can be invoked simply by typing:

	TRILOG   MYFILENAME	(.PLT extension is assumed and must NOT be specified)
	TRICOLOR MYFILENAME	(.PLT extension is assumed and must NOT be specified)
	VIEW	 MYFILENAME  {Start plot #  0,1 } 0= uniform X,Y scaling
				and 1 = stretch to fit plot area. Both of
				these arguments are optional.




SECTION VII.	ADDITIONAL COMMENTS
-----------	-------------------


	CURVY is now available (for more infor see CURVY.DOC).
	Just type:

	CURVY MYFILENAME  (extension .DAT is assumed and must NOT be given)
or
	CURVYF MYFILENAME  (Faster  but requires  2G14.6 formatted data)
or
	CURVYC MYFILENAME  (as CURVY but invokes TRICOLOUR for Colour Plots)