PSGRAPH
Section: Misc. Reference Manual Pages (1.1)
Updated: 7 November 1990
Index
Return to Main Contents
NAME
psgraph - generate a graph in PostScript
SYNOPSIS
psgraph
[ option ] [ files ]...
DESCRIPTION
Psgraph
operates in a manner similar to
graph(1),
in that it reads pairs of numbers from its standard input
and produces a graph.
If files are given as arguments, each file is processed to produce a separate
graph.
The output language is a complete
PostScript
document, suitable for inclusion in a Scribe or TeX document, or, with the
-P
flag, printing directly on a PostScript printer.
Several differences exist between
graph
and
psgraph,
the most significant of which is that
psgraph
can take all of its parameters
(except
-P)
from its input instead of requiring that
everything except data be on the command line.
OPTIONS
All the options of
graph
are supported, except
-s.
The meaning of the
-h,
-w,
and
-c
options have changed.
A few new options have been added as well.
- -h
-
Next argument is the height of the graph in inches.
- -w
-
Similarly for width.
- -c
-
Center the X axis of the graph on the page width specified by the next argument
(in inches).
- -P
-
Produce an output file with a
showpage
command at the end of each graph, and a
translate
command that assures that the entire graph will appear on the output page.
- -p
-
Use the file named by the next argument as the PostScript prologue, instead of
the standard one.
This allows you to define new line styles and marker shapes.
INPUT
Input is line oriented; lines beginning with a pound sign are ignored.
Each line either specifies a data point (one or two numbers followed by an
optional label) or a command.
Lines are parsed into fields separated by white space.
A string of text enclosed in quotation marks or apostrophes is considered a
single field.
Command lines consist of a keyword followed by zero or more modifiers.
Some commands affect the entire graph (such as one to specify the grid type)
and so can be placed anywhere in the input (though placing them at the top
is conventional).
Other commands only affect the data that follows them (such as the one to
modify the line or marker type).
Data points in the input are interpreted as in
graph(1).
If the
-a
option is specified, only one number is expected, otherwise two.
If a label (second or third field) is given, that label is printed on the
graph at the location of the point given on the same line.
The following commands are recognized:
- CMD
-
DESCRIPTION
- break
-
Break the plot at this point in the input.
- include F
-
Switch to reading input from the file
F.
Yes, recursive
includes
are handled properly.
- line S
-
Connect subsequent points with a line of type S,
where S is
solid,
dotdashed,
shortdashed,
longdashed,
dotted,
or
off,
with or without quotes. If S is omitted, splines are turned
off (if on) and the line type remains unchanged.
- color C
-
Set the color to be used in subsequent lines to be the one named "C",
where C is
red,
blue,
magenta,
green,
black,
cyan,
yellow,
gray,
orange,
or
violet,
with or without quotes. If C is omitted, the color is set to black.
- linewidth D
-
Sets the width for subsequent graphed lines. The argument is a floating-point
number, and is the number of points of line width. There are 72 points to an
inch. The default line width is 0.6 points.
- transparent
-
Normally, the label associated with a point is painted with a white background,
obliterating any text or graphics behind it.
This command causes the text to be painted without first painting a white
background box.
- notransparent
-
When painting a point label, first paint a white background box behind it.
- label
-
Place numeric labels on the end of each grid line.
- nolabel
-
Do not place numeric labels on grid lines.
- tick N [M]
-
Make grid tick marks (for
grid tick)
N inches long.
A second numeric parameter M states the length of secondary tick marks -
those generated by the
x tick N
command.
- datatick
-
Place ticks only where there is a data point.
- datalabel
-
Label every datatick.
- grid N
-
Draw grid type N, 0=no grid, 1=frame grid, 2=frame grid with tick marks,
3=mesh grid, 4=frame grid with only left and bottom axes, 5=grid 4 with
tick marks.
Gets applied to both dimensions. Also, the more descriptive
none,
open,
tick,
full,
halfopen,
or
halftick
may be used.
For historical reasons, grid type 3,
full,
is the default.
- rangeframe
-
For all grid types except
none
and
full,
only draw the axis line over the range of the data on that axis.
Ticks or scales, if any, are drawn on the entire axis.
- tickgray f
-
Draw the ticks in f percent gray; default is 100% (full black).
- axisgray f
-
Draw the ticks in f percent gray; default is 100% (full black).
- clip N
-
Data points and connecting lines are clipped to the grid, to some
tolerance. The default tolerance is 0.05; that is, if the data value lies
up to 5% outside the axis limits, it will be plotted. The
clip
verb is used to change the value of this tolerance.
Log scale users should be warned that the calculation is done in ``linear
space'' and will often not behave as expected.
- font f
-
Switch to font
f
for subsequent marker label text.
Fonts are named as for
enscript(1),
e.g., ``Times-Roman10''.
- width N
-
Make the grid N (float) inches wide.
Overridden by the
size N
command.
- height N
-
Make the grid N (float) inches high.
Overridden by the
size N
command.
- center N
-
Center the X axis on an N (float) inch wide line.
- spline
-
Subsequent data is plotted as splines. Causes
a break.
Markers, if turned on, still appear at the actual data point.
- marker m
-
Plot subsequent points with marker type
m.
If
m
is
none,
off,
or omitted, markers are turned off.
Otherwise, valid values for
m
are
square,
diamond,
triangle,
up,
down,
right,
left,
circle,
x,
plus,
cross,
circle-x,
circle-plus,
filledsquare,
filleddiamond,
filledtriangle,
and
filledcircle.
- markerscale s
-
Scale the markers (if they are turned on) by the floating point scale value
s.
The default value for s is 1.0.
- markergray f
-
Draw the markers in f percent gray; default is 100% (full black).
Any subsequent color command overrides this setting, and this
overrides only the marker color if a color command has been issued.
- title foo
-
Use
foo
as the title for this plot (displayed at the top).
- titlefont bar
-
Display the title in font
bar.
Fonts are named as for
enscript(1),
e.g., ``Times-Roman10''.
- x args
-
Modify x data processing (see below)
- y args
-
Modify y data processing (see below)
The arguments for the
x
and
y
commands can all be placed on a
single line, or separate
x
and
y
lines can be used for each.
- log
-
Plot this dimension on a logarithmic scale.
- min N
-
Minimum on the grid is N (float)
- max N
-
Maximum on the grid is N (float)
- step N
-
Distance between grid lines and numeric labels is N (float). No effect for
linear scales.
- tick N
-
Distance between secondary ticks is N (float). No effect for log scales.
- intervals N
-
Number of intervals in a decade is N (integer). No effect for linear scales.
- datatick
-
Place ticks only where there is a data point.
- datalabel
-
Label every datatick.
- offset N
-
Distance between border of page and minimum edge of the grid in this
dimension is N (float) inches.
- rangeframe
-
For all grid types except
none
and
full,
only draw the axis line over the range of the data on that axis.
Ticks or labels, if any, are drawn on the entire axis.
- tickgray f
-
Draw the ticks in f percent gray; default is 100% (full black).
- axisgray f
-
Draw the ticks in f percent gray; default is 100% (full black).
- label foo
-
Use
foo
as the label for this axis.
- size N
-
Make the grid this big (N is in inches).
Overrides the
width
and
height
commands.
- grid N
-
Specify the grid type in this dimension (as above).
- font foo
-
Draw the axis labels in font
foo.
Fonts are named as for
enscript(1),
e.g., ``Times-Roman10''.
FILES
/usr/local/lib/ps/psgraph.pro - standard prologue
SUGGESTIONS
Many of the options are provided to minimize
chartjunk,
that is, to maximize the data to ink ratio.
To this end, the grid types
halfopen
and
halftick
are the most useful.
Rangeframe
and
datatick
were designed to make a standard bivariate scatterplot more useful.
All the graphical elements of the frame can be removed, either by careful
selection of the grid type, the various gray settings, or
nolabel.
SEE ALSO
enscript(1), graph(1), psgsimp(1)
Tufte, Edward, R.
The Visual Display of Quantitative Information.
Graphics Press, P.O. Box 430, Cheshire, CT. 1983.
Tufte, Edward, R.
Envisioning Information.
Graphics Press, P.O. Box 430, Cheshire, CT. 1990.
BUGS
A superset of the bugs listed in
graph(1).
There are almost certainly too many options.
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- OPTIONS
-
- INPUT
-
- FILES
-
- SUGGESTIONS
-
- SEE ALSO
-
- BUGS
-
This document was created by
man2html,
using the manual pages.
Time: 06:26:04 GMT, December 12, 2024