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

Command files

Computer Facility University of Hawaii at Manoa
College of Engineering

Similar to shell scripts, gnuplot allows you to use command files to contain your commands to Gnuplot. These files are plain text files, and contain the commands which will be given to Gnuplot. Each line can contain a single command, or several commands separated by semicolons (;).

You can also create these files by using the save command. For example, typing save "datafile" creates the file datafile containing the commands to restore the present state of all variables. The most recent plot or splot command is also included in this file.

You can start Gnuplot with the command file as its argument. From the previous example, if you were to type gnuplot datafile at your Unix (or DOS) prompt, gnuplot would execute the commands, and terminate. You may wish to add the pause command as follows:

pause -1 "Hit return to continue"

If a command line in the file is too long to fit on a single line, you can use the backslash (\) as the last character of the line to continue the current line on the next line. You can also add comments to your command file by putting a pound symbol (#) as the first character in a line. Similar to lines containing commands, comment lines can be continued on subsequent lines by placing a backslash at the end of the line.

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.