Section: User Commands (1)
Return to Main Contents
genplot, makeplot - generate X-Y plots in HPGL, from files of numbers
generates an X-Y plot from columns of numbers.
All input files and parameters are specified via command line options.
The HPGL output is sent to the standard output, which should be
redirected to the file you want to create.
is an easier to use front-end program, that prompts for input
file names and various options, and passes these along to
It also saves the output to a file, and if you're on an X
terminal, it displays the result using
There are some options in
doesn't prompt - these can be provided as option arguments.
It doesn't pass any options on to
so any X Window options would have to be passed via environment
HPGL output files can be viewed or converted using the programs
they can be printed using
or they can be incorporated into a
Below is a list of the command line options allowed by
Each should be specified as a single argument, with no space
between the option code and the following value.
Specifies the input file from which the X-axis values will be read.
This file name can be a single hyphen
which will cause input to be read from the standard input.
The input file should contain lines of real numbers
(floating point numbers in ASCII form), with one or more numbers
per line, separated by spaces, tabs, commas, colons, semi-colons,
Any number of separators can appear between columns of data, as
columns are counted by the number of data values on the line.
Missing data values on some lines can throw off the count.
If you want a fixed field separator, and only allow one separator
between columns, use the
Numbers will be read only from the column you specify as
the X-axis input column, using the
Blank lines are skipped, but any other lines that don't begin with a number
will cause reading to end there, unless it is among those you skip using the
Files generated by
are ideal for use as input files here, but they can come from any
other source as well.
Specifies the input file from which the Y-axis values will be read,
as for the X-axis file above.
You can use the same file name for both X and Y, if you take
different columns for each axis.
However, the standard input
should only be specified for one of
these, as it can't reopen it to reread it.
If either this option or the
option is omitted, the missing data will be made up from an
ascending sequence of 1 to
is the number of points taken from the other file.
At least one file must be specified.
Usually this is the Y-axis file.
If two separate files are read, or two separate columns from one
file, the number of points read for each axis must be equal to
that of the other axis.
- -xlskip or -ylskip
Specifies the number of non-blank lines to skip at the start of
the X or Y axis data file, before reading in numbers.
By default, none are skipped.
- -xnnlines or -ynnlines
Specifies the number of values to read from
the X or Y axis data file.
By default, it continues until end of file is reached.
If this number is specified, and less values are read, you will
get a warning message.
- -xccolno or -yccolno
Specifies the column from which numbers will be read in
the X or Y axis data file.
This is column 1 by default.
- -xsscale or -ysscale
Specifies a scaling factor by which numbers read in for
the X or Y axis data file will be multiplied.
This factor is 1 by default.
- -xooffset or -yooffset
Specifies an offset by which numbers read in for
the X or Y axis data file will be shifted.
This number is added to the data after it is scaled by the
This offset is 0 by default.
- -xgtickgap or -ygtickgap
Specifies the gap between tick marks on
the X or Y axis.
By default, a reasonable tick gap is calculated based on the
Y or Y axis range.
For polar plots, if a tickgap of 1 is given for an axis, and the range for
that axis is 0,1 then the two labels, 0 and 1, will not be shown for that axis.
The labels would just add clutter to a simple unit circle.
- -xrrange or -yrrange
Specifies the range of values to be displayed on the X or Y axis.
By default, the axis is automatically scaled to fit the minimum
and maximum values found in the data.
Specifying the scale explicitly gives you more control over the
graph's appearance, and can be used to get a consistent scale
across multiple graphs, if these are to be combined.
In fact, multiple sets of data can be overlaid by concatenating
the HPGL plot files for several graphs, after suppressing the
plotting of axes for all but one graph, using the
is given as
within the same argument (i.e. no spaces).
- -xhlabel or -yhlabel
Specifies the label which will be placed below
the X axis or to the left of the Y axis.
By default, it will use the file name.
These are not placed on polar graphs.
Specifies the plotter pen number to be used for plotting the axes and
This must be a valid HPGL pen number (1-8), or
to suppress plotting.
Pen 1 is used by default.
Specifies the plotter pen number to be used for plotting the data
points and connecting lines, if any.
Pen 1 is used by default.
Specifies the plotter line type to be used for plotting the lines
connecting data points.
Valid line types are
for solid lines,
for dotted lines,
for dashed lines,
for long-dashed lines,
for dashed/dotted lines,
for alternatingly long and short dashed lines,
for long/short/short-dashed lines,
or a hyphen
to suppress connecting lines.
These correspond to the line types available in the
Solid lines are used by default.
Specifies the marker symbol to be used for plotting the data points.
The symbol can be selected by using one of these characters for
. A solid (filled) circle.
o A circle outline (not filled).
b A solid square block.
s A square outline.
t A triangle outline.
d A diamond outline (square rotated 45 degrees).
x An X-shaped cross.
By default, the diamond symbol is used.
You can also have a character label placed at each data point,
centered vertically and horizontally,
instead of one of these symbols, by specifying a hyphen as the
and following it with the character or string of characters you
want as the marker label.
to get a
sign at each data point.
This option is especially useful if the graph is to be edited in the
The tag characters in the
graph can be changed to use any character in the "+special" or
Specifies the width of the marker symbols, in millimetres.
They are 2 mm by default.
A width of
causes the markers to be suppressed.
Specifies that circular statistics should be calculated and plotted.
The mean angle,
and the concentration of points,
are shown, and a line of radius
is drawn at the angle
This is intended for use with polar plots.
are given, the Rayleigh's critical value for
is calculated and shown, plotted as a dotted line at each probability level.
If more than one probability is given, they should be separated by commas
within the same argument (i.e. no spaces).
Specifies that data in the data files have fixed field separators,
and are not free-format.
is given, this will be the only field separator allowed in the files.
If omitted, any single one of the following will be allowed as a separator:
tab, comma, colon, semi-colon, or parentheses.
Only one separator will be allowed between each column, so if two
separators appear in a row with no number in between for the column you
selected, the data value is assumed to be missing and the line is skipped.
Specifies unlimited plotting.
This will disable clipping of data points that are outside the
range specified by the
Specifies that a polar plot should be generated, rather than a
conventional Cartesian X-Y plot, to show data of a cyclical nature.
The X coordinate determines the angle where a point is drawn, and
the Y coordinate determines the radial distance of the point from
the centre of the graph.
This works best if the Y axis is explicitly scaled, with a
minimum value of 0.
It is also a good idea to scale the X axis in degrees, from 0 to 360.
- -A, -B, -A3 or -A4
By default, the output graphics are set up for an HP plotter with
These page size options,
adjust the coordinate system and aspect ratio to correspond to
the plotter's defaults for that page size.
The default page size can also be changed by setting the
to one of the above page sizes.
program will prompt for most of the options it needs.
For each question, the default answer is shown in brackets.
If you just hit RETURN, this value is used.
Otherwise, you can enter the value you want, and hit RETURN.
You are asked for the Y axis file name.
If you give one, you are also asked for the number of points
(or lines) to skip in this file, the number of points to read,
and the column number.
The same thing is repeated for the X axis.
Next, you are asked if you want a polar graph,
and if you want axes plotted.
If you want axes, you are asked for the pen number for axes.
Then, you are asked for the pen number for the plotted data.
You are then given a menu of line types available (including
an entry for no lines), and are asked to pick one.
Similarly, you must pick the symbol type from a menu.
If you pick a character symbol type, you are asked for the
character or characters to use.
Unless you specify no symbols, you are also asked for the symbol
You are then asked for the Y axis data range, followed by the X
axis data range, for purposes of scaling the graph.
Automatic scaling is the default.
Finally, you are asked for the HPGL output file name.
then generates the graph, and on an X terminal, starts up
to display it.
- genplot -xftfdata.csv -xc1 -yftfdata.csv -yc2 -xp1 -yp2 -xhTime (ms) -yhFreq (Hz) -yr0,100 | xhpgl
Plot of X & Y axis data read as columns 1 & 2, respectively,
from the same file, with axis labels and Y-axis range specified,
and different pens used for axes and data.
Output is viewed on-screen directly using
command, rather than saving to a file.
- crosscorr -l150 apj402-56.csv | genplot -yf- -yc2 -yw0 > apj-cc56.plt
Plot of cross-correlation as a line graph, with Y-axis data piped in,
and X-axis data as a linear sequence.
Output is redirected to a
joinnum(1), emuhpgl(1), hardcopy(1), layout(1)
- SEE ALSO
This document was created by
using the manual pages.
Time: 20:21:27 GMT, November 21, 2017
Copyright © G. R. Detillieux,
Spinal Cord Research Centre,
The University of Manitoba.