College of Engineering Logo Web Server Logs Student Server Logs Orange bar Main Page General Information Special Events Programs Research Student Information Computer Facility Outreach Xtreme Engineering Jobs Available

Printing plots to NetPBM format files

Computer Facility University of Hawaii at Manoa
College of Engineering

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 follows:

    set term pbm small color
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 as follows:

set size 0.3125,0.4167
or
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.)

Author: Ben Yoshino (ben@wiliki.eng.hawaii.edu)

Comments, Questions? | E-mail: webmaster@wiliki.eng.hawaii.edu


Last updated on Thursday, August %.1d, 2002
Copyright © 2001 University of Hawai`i, College of Engineering, Computer Facility
All rights reserved.