GNU graphics metafiles are produced by the raw variants of
by any other graphics application that uses the Metafile Plotter support
contained in GNU
libplot. A file in this format is a sort of
audit trail: a sequence of plotting commands, each of which may be
followed by data. Each plotting command is an `op code': a
single ASCII character, indicating a Plotter operation. The data
following the command are the arguments passed to the operation, if
There are two sorts of GNU graphics metafile: binary (the default) and
portable (human-readable). Binary metafiles begin with the magic string
"#PLOT 1\n", and portable metafiles with the magic string
"#PLOT 2\n". If you wish to transfer metafiles between machines
of different types, you should use portable rather than binary format.
Portable metafiles are produced by GNU
graph and the other
plotting utilities if the `-O' option is specified, and by Metafile
Plotters if the
META_PORTABLE parameter is set to "yes". Both
binary and portable metafiles can be translated to other formats by GNU
In the portable format, the arguments of each operation (integers,
floating point numbers, or strings) are printed in a human-readable
form, separated by spaces, and each argument list ends with a newline.
In the binary format, the arguments are represented as integers, single
precision floating point numbers, or newline-terminated ASCII strings.
Using the newline character as a terminator is acceptable because each
libplot operation includes a maximum of one string among its
arguments, and such a string may not include a newline. Also, the
string must come last among the arguments.
closepl operations open and close a
Plotter, i.e., begin and end a page of graphics. They are represented
by the op codes `o' and `x', respectively. The
erase operation, if present, separates frames within a page. On
real-time display devices, it is interpreted as a screen erasure.
It is represented by the op code `e'.
Each of the 89 other Plotter operations has a corresponding op code,
with 12 exceptions. These 12 exceptions are (1) the setup operation
flushpl, (2) the operations
flabelwidth, which merely return
information, (3) the
bgcolorname operations, which are
internally mapped to
bgcolor, (4) the
ftranslate operations, which are internally mapped to
fconcat, and (5) the
ffontname operation, which in a
metafile would be indistinguishable from
besides `o' and `x', there are 78 possible op codes,
for a total of 80. The following table lists 10 of the op codes
other than `o' and `x', followed by the name of the
libplot operation they stand for.
The full set of 80 op codes is listed in the header file `plot.h', which is distributed along with the plotting utilities. On most systems it is installed in `/usr/include' or `/usr/local/include'.
It is worth noting that of the 80 op codes, only 50 are used in
portable metafiles. That is because in ASCII format, there is no point
in distinguishing the floating point
libplot operations from
their integer counterparts.
The 10 op codes in the table above are actually the op codes of the
traditional `plot(5)' format produced by pre-GNU versions of
libplot. The use of these op codes make GNU
metafile format compatible with plot(5) format. The absence of a magic
string, and of the `o' and `x' op codes, makes it
possible to distinguish files in plot(5) format from GNU metafiles. GNU
plot can convert files in plot(5) format to GNU metafiles in
either binary or portable format.
Go to the first, previous, next, last section, table of contents.