pro5plot - PRO/5 Plot Filter
Description
The pro5plot
utility is a stand-alone program. It is a plot filter that takes its input
from PRO/5 and produces plots on a variety of output devices, listed below.
The output devices are special in that they do not support vector graphics
directly. The pro5plot
utility accepts vector graphics commands from PRO/5 and produces native
graphic output for each device it supports. It uses a similar termcap
entry for all output devices.
The pro5plot
program supports the following output devices on all platforms where PRO/5
runs:
-
HP Laserjet (II, IID, IIP, III, IV, and IVM)
-
HP Deskjet
-
HP Quietjet
-
Epson FX and LQ Series and true compatibles, such as IBM ProPrinters
-
Mannesmann Tally 80 and 180 Series
The HP Laserjets are supported via PCL2, which is the Printer Description
Language for the HP Laserjet II. The pro5plot
utility can utilize any printer that can be controlled by PCL 2.
The pro5plot
utility may also support console graphics and X Windows, along with other
output devices. The output devices supported depends on the particular
environment a user is running. For example, if a system does not support
X Windows, Version 11, pro5plot
will not be able to support X Windows. It is possible that a system does
not have the support for a graphics device, but pro5plot
was built to support that device because of what was available at the
time the pro5plot
program was created.
To determine which devices are supported within a specific environment,
type pro5plot
at the shell prompt. The pro5plot
program will give a usage printout
containing a list of supported devices. A usage message explains the available
options. The pro5plot
program requires users to select a plot output device with the -p <plotter>
option. If pro5plot
is invoked without the -p option, a usage message will appear. There is
no default. The usage message may look like:
$ pro5plot
usage:
pro5plot -p <PLOTTER>
-k [Plotter Specific Options]
where <PLOTTER> is one of hplj2, X11,
qjet, efxsgl, efxlsd, efxquad,
efx9sd, efx9dd, elqsgl, elqdbl,
elqtpl, elqhex, mtsgl, mtdbl
pro5plot Usage Message
Keeping a Plot Displayed
The -k option is always available but may not always be supported by the output device selected in the -p option. The -k option is used for display devices and tells the output device driver in pro5plot not to exit once drawing commands are completed. The following draws the figure described by plotcmds., When an end-of-file is detected in reading plotcmds, pro5plot will exit and restore the graphics console:
pro5plot -p vga < plotcmds
In the following example, pro5plot will continue to keep the figure drawn on the screen, even after an end-of-file is detected. In this case, pro5plot will only exit when it receives an interrupt signal (usually the DEL or ^C).
pro5plot -p vga -k < plotcmds
Specific Device Usage
Further usage information can be requested from pro5plot for each plot device supported by typing pro5plot -pPLOTTER?, where PLOTTER is the output device intended for use and ? causes the usage message to print. For example:
pro5plot -p hplj2 ?
hplj2 options usage:
[-r <RES>] [-2] [-s <SAVEFILE>] [-m] [-d <P|L|IP|IL>]
[-2] [-v virtual]
where <RES> is one of 75, 100, 150,
or 300 (dots/inch)
-2 changes pen width to two
(default is one)
<SAVEFILE> is the path to save the plot file
-m requests memory bit map rather than disk
file bit map
-d <P|L|IP|IL> specify the orientation of
the plot: either Portrait, Landscape,
Inverse Portrait or Inverse Landscape
-v sets the virtual resolution
pro5plot Expanded Usage Message
Virtual Resolution Plotters
Many of the plot devices supported by pro5plot
use a virtual resolution. For example, the X Windows interface supports
a 1024 by 1024 virtual plot resolution. In the termcap file used by PRO/5
(termcap), the px and py entries should both
indicate a resolution of 1024. The pro5plot
program maps the plotting commands sent by PRO/5 to the actual size and
points in the X Window being plotted.
Printer support in pro5plot
also includes virtual resolution support. However, unlike X Windows, printer
support includes the ability to change the starting location of the plot
along with the width and height of the plot. The HP Laserjet, Deskjet,
and Quietjet printers are exceptions to this rule. The printer support
for these printers does not allow users to specify a starting location,
nor a width and height.
On an X Windows device, the virtual resolution is fixed at 1024 x 1024.
For printers, the virtual resolution is defaulted to 1024 x 1024, but
because a printer's resolution can be 300 or more dots per inch, it is
necessary for pro5plot
to allow a change to the virtual resolution to avoid sparse areas in plots.
The -v option for printers tells pro5plot
to use a different virtual resolution. For example, when users specify
-v 3600, pro5plot
changes its virtual resolution to 3600 x 3600. The lines and points transmitted
to pro5plot
from PRO/5 are then mapped to the correct dot positions on the printer.
If users change the virtual resolution of pro5plot, the termcap entry must also be changed (or a new one created) for PRO/5.
Changing the virtual plotting surface can create problems for users who want all plots to be square. PRO/5 assumes that the plotting surface is square and generates plotting commands accordingly. For many devices, the plotting surface is rectangular, and the pro5plot program can be used to overcome any problems caused by this assumption.
Creating a Square Plot
For dot matrix printers, pro5plot
permits users to change the size of the plotting area. The virtual resolution
specified is then mapped into the new area. By default, the plotting area
on a dot matrix printer is a standard 8" x 11" page. For wide
carriage printers, this may not be satisfactory.
The -x, -y, -w, and -h options allow users to specify a starting location
for the plot and its width and height. The starting location is always
the top left-hand corner of the page.
Even though pro5plot
permits dot matrix printer devices to change the relative orientation
of the output plot, the relative origin for specifying the starting x
and y coordinates of the page is fixed. That is, once pro5plot
determines where (on the page) the plot is, it then determines how plot
commands are translated with respect to the orientation of the plot. The
orientation of the plot is specified with the -d orientation
option. The plot can be oriented in one of four ways.
-
portrait (p or P)
-
landscape (l or L)
-
inverse portrait (ip or IP)
-
inverse landscape (il or IL)
A portrait plot has a relative origin at the top left of the page.
A landscape plot has an origin at the top right of the page. An inverse
portrait plot has an origin at the bottom right of the page (the plot
is upside down from a portrait plot). An inverse landscape plot has
an origin at the lower left of the page (the plot is upside down from
a landscape plot). The default plot orientation is landscape.
The orientation of the plot does not affect how square plots are obtained.
To obtain a square plot, first consider the size of the plot. A four-inch
square plot, centered in the middle of an 8.5 inch x 11 inch page,
use the following formulas:
xloc = (8.5 - 4)/2 * printer's horizontal resolution
yloc = (11 - 4)/2 * printer's vertical resolution
width = 4 * printer's horizontal resolution
height = 4 * printer's vertical resolution
These values are then used as arguments to -x, -y, -w, and -h.
To center a plot on the page, the xgap
and ygap (the centered distances
from the page origin), the desired width and height, w
and h, the printer's horizontal
resolution, hres, and the
printer's vertical resolution, vres
must be known The values needed are the arguments to -x, -y, -w, and
-h. These are xarg, yarg, warg,
and harg, respectively. Finally,
the printer's horizontal and vertical size, hsize
and vsize, must be known.
In the following example, the units for hsize,
vsize, xgap,
and ygap are called PUNITS.
The hres and yres
values are in DOTS/PUNIT. The arguments
are in DOTS. Below are the formulas
to compute the arguments for -x, -y, -w, and -h:
xarg = (hsize - xgap) / 2 * hres
yarg = (vsize - ygap) / 2 * vres
warg = w * hres
harg = h * vres
For the HP Laserjet, HP Deskjet, and HP Quietjet, pro5plot
does not provide plot positioning options, nor sizing options. The
plot will always use the entire page. Therefore, users must restrict
the plot output to make the plot square. This is done from the termcap
entry. Termcap entries are provided such as square# and square#-2,
where the # is the resolution specified and -2 means double pen width.
See termcap for additional
information.
An example of a square entry is:
>pro5plot -p hplj2 -m -2 -d p | lp -dhp -s 2>/dev/null
In this example, pro5plot
is generating a square bit map in memory, using a pen width of 2 in
portrait mode. It is piping output to a spooled printer called "hp."
Some plots benefit from different
plotting surfaces. For example, with bar charts, use a rectangular
plotting surface; for pie charts, use a square plotting surface.
Bit Map Files and Memory
For plot drivers that produce output for very high resolution devices,
pro5plot
uses a file to contain the bit map being created, before transmitting
to the printer. The pro5plot
utility uses a bit map file by default to avoid impacting overall
system performance. To utilize memory to build the bit map file, use
pro5plot
with the -m option.
Using memory provides a speed advantage. Because the bit map is being
created directly in memory, disk performance is not a factor when
reading and writing the bit map. The disadvantage of using memory
is that it impacts the overall system performance. Use caution when
selecting this option.
Doubling the Pen Width
The pro5plot program also allows users to double the pen width by using the -2 option. When using this option, be certain to change the pen width in PRO/5 by changing the pw# termcap value in the appropriate termcap entry and referencing that entry in CONFIG.PLT. This option is only valid for printer devices.
Saving the Plot Output to a File
If users select a printer device, the pro5plot output can be saved to a file for use at a later time. To save the output to a file, use the -s option. The argument to -s is the fully qualified filename into which the data should be saved. This file is created. Do not specify the name of an existing file. This option is only valid on printer devices.