From http://www.math.utk.edu/~vasili/refs/How-to/gnuplot.print.html

1.  Producing postscript files
First you prepare your plot as you want it in gnuplot. Then:
gnuplot> set term postscript     (will produce postscript output)
gnuplot> set output "printme.ps" (output to any filename you use)
gnuplot> replot (recreates plot but you don't see it, goes to file)

gnuplot> set term x11 on unix   or: set term win on win
(resets the normal terminal so you can do more plotting)

Now you have a postscript file named printme.ps containing your plot.
You can view it with ghostscript: UNIX> gs printme.ps
or with ghostview : UNIX> ghostview printme.ps
or print it: UNIX> lpr printme.ps
or produce .pdf: UNIX> ps2pdf printme.ps printme.pdf

2. Producing png   (image file, similar to .jpg)
gnuplot> set term png (will produce .png output)
gnuplot> set output "printme.png" (output to any filename you use)
gnuplot> replot
gnuplot> set term x11