Introduction to the Figure Package
Introduction to the Package figPac
This package provides a library of Java routines for drawing figures to
screen and/or to PostScript. A
figure is to be thought of as a sequence of figure elements. Technically,
a figure element is any instance of any class that
implements the interface
fElement.
I use the convention that these classes all have names starting with a lower case f
(standing for figure) followed by a capital letter.
Most figure elements will be lines, polygons, arcs and so
on. I have provided classes for the following standard figure elements.
- fArrow: Draws an arrow.
- fArrowhead: Draws an arrowhead.
- fAxes: Draws the x and y axes,
puts ticks on the axes, gives the coordinate values corresponding to
the ticks and puts labels on the axes.
- fBezier: Draws and/or fills a
smooth curve through a given sequence of points.
- fCurve: Draws and/or fills a
curve given by a formula.
- fDisk: Draws and/or fills a
circular or elliptical disk.
- fEllipticalArc: Draws a
circular or elliptical arc.
- fLabel: Prints a label.
- fLine: Draws a line segment.
- fParticleLine: Draws a Feynman diagram particle line.
- fPolygon: Draws and/or fills a polygon.
- fResistor: Draws a sawtooth line.
- fSquiggle: Draws a squiggly line.
- fTeXlabel: Creates a label
that may be used within a TeX file.
There is a second class of fElements for modifying the drawing environment and the coordinate system.
- fEnv: Used to change the drawing environment. That is, to change fonts, colours and so on.
- fRotate: Used to rotate the coordinate system.
- fScale: Used to scale the coordinate system.
- fTranslate: Used to translate the coordinate system.
Finally, there is the special fElement
- fSubFigure: Creates a subfigure, which itself consists of a sequence of fElements. It is
designed to allow recursive use, so that you can have subfigures of subfigures of subfigures and so on.
More introductory material is provided in
and a number of examples are provided in
I have done a couple of things to reduce the number of keystrokes required
in the preparation of Figures. One is prepare a "template" class called Template
that has built in typical methods for displaying figures to screen and to Postscript file
as well as a number of "shortform" methods and variables. See
Another is to create a crude "point and click" interface to figPac
named figEdit.