ECN No Name Newsletter: May, 1987

The ECN No Name Newsletter is no longer being published. This is an archived issue.

[previous article] [next article]

Including Qplot Graphics in your Troff Documents

Stacey Clark and Kent De La Croix

Perhaps you would like to include graphs drawn using qplot in a troff document you are writing. This can be accomplished by converting the graph drawn by qplot into a pic file which can be included in your troff document. This document can then be processed using pic and troff for output on a Printronix or laser printer.

To convert your qplot graph into a pic file you need to use the ``-P'' option of qplot to have it generate plot(5) format output which is then converted to a pic file using the ``-Tpic'' option of the plot command. For example, the command:

  $ qplot x=xfile,a  y=yfile,a  -P | plot  -Tpic > graph

would cause the graph drawn by qplot to be converted to the pic file ``graph''.

If you look at the pic file created by qplot and plot, you will notice that the first line is ``.PS 5''. The ``5'' tells pic to make the drawing five inches wide. If you'd like the drawing to be different size simply change the ``5'' to the desired width in inches and pic will scale the drawing accordingly.

Now that you have a pic file you are ready to incorporate it into your troff document. One way of doing this is to edit your troff document and use the appropriate editor command to read the pic file into your document at the place in the text where you wish the graph to appear. You would then process this document just as you would process any troff document containing pic commands. For example, the command:

  $ mmt.  -Tptrx  -p  -e document | dptrx | lpr  -Pxp  -n

would print a document containing text, equations, and qplot graphs on the ``xp'' Printronix printer.

The pic files generated by qplot and plot are often large so it may be inconvenient to include them directly in your troff document. Another way of incorporating a pic file in a troff document is to edit your document and insert a line containing ``.PS $ pic -Tptrx document | mmt. -Tptrx -e - | dptrx | lpr -Pxp -n

would print a document containing text, equations, and lines like ``.PS For additional information on including qplot graphs in your troff documents please read the article "Notes On Using Pic To Include Qplot/PicSure Graphics in a Troff Document" on page 6.


webmaster@ecn.purdue.edu
Last modified: Saturday, 01-Nov-97 13:28:23 EST

[HTML Check] HTML