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

Using the Postscript Printer with Gnuplot

Computer Facility University of Hawaii at Manoa
College of Engineering

Gnuplot supports the PostScript page definition language which is used by the PostScript printer located in Holmes 244. You must use the set term command to set the terminal to postscript, as shown:

set term postscript
The PostScript terminal setting has a few options which affect the way a PostScript plot is created. These options are followed after the key word, postscript. Because the settings are optional, they may be omitted in the set term command.
  • The first of these options is the mode, which can be one of the following: landscape, portrait, eps or default. Landscape and portrait determine the orientation of the paper when the plot is printed. The eps option allows you to create an encapsulated PostScript file, which can then be embedded into documents. (When the eps mode is chosen, the size of the image is halved in size.) Default resets the postscript terminal to its default setting (10 inches by 7 inches, landscape mode using 14 point Helvetica font.
  • The next option is the color setting, which can be either be color or monochrome.
  • The third option is the dashed line, which can be either be dashed or solid, which determines if the lines in the plot are dashed or solid.
  • The last two options determine the font and size used for printing captions and titles in the plot. The font name is enclosed in quotes, followed by the font size in points.
  • In addition to setting the terminal type for Gnuplot, you must also set the output file. There are two methods to plot your output to the printer. You can first save the output to a file and send that file to the printer, or you can directly print to the printer. In order to send the output to a file, use the following set output command, substituting your own file name for filename.ps:

      set output "filename.ps"
    You then send that file to the PostScript printer with this command: (typed at the Unix prompt)
      lp -dpostscript filename.ps

    You can also set the output file to plot directly to the printer. However, remember to note that you must bring your own paper when sending the output to the printer. In order to send the output to the printer (thereby bypassing the need to create a plot file), use the following set output command:

      set output "|lp -dpostscript"
    For both of these output methods, the file is not "sent" until another output (or the same output) file is selected, or until Gnuplot terminates. After you are done with one plot, simply type the same set output command to "flush" the file.

    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.