Printing plots to NetPBM format files
A D V E R T I S E M E N T
Instead of viewing the plot directly or creating a hard copy of the printer,
you may also save your plot to a graphics format file. There are many graphics file
formats available, but this page will describe the creation of files in the
Portable Bitmap Format (pbm).
You use the set pbm command. You can specify whether the pbm
image uses small, medium or large font sizes, as well
as monochrome, gray or color images. For example, to
create a pbm image using a small font and color, the command would be as
In addition to setting the terminal type, you will also need to set the output
file name. When the plot is created you will have a 640 by 480 pixel image
stored in the file. The file name is set using the set output
command, followed by the filename:
set output "output1.pbm"
For this output method, the file is not "saved" until another output file is
selected, or until Gnuplot terminates. After each plot, simply type another
set output command to "flush" the file.
If you want a plot of some size other than 640 by 480 pixels, you can scale
the width and height of the plot by using the set size command.
For example, if a plot of size 200 by 200 is desired, you would scale the X
dimension by 0.3125 and the Y dimension by 0.4167. The corresponding command is
set size 0.3125,0.4167
set size 200.0/640,200.0/480
After the plots have been made, you can use the xv program
to view these images and save them as other formats (such as Gif or Tiff) to
import them into your documents. You can also use the NetPBM
pacakge to manipulate as well as convert your files. (Note: The
NetPBM tutorial is still under construction.)