Setting the Gnuplot Output Device

set terminal <device-type>
Set the "terminal" (output device) to <device-type>. Some common options are x11 (the X display, the default setting), postscript, and png.

set output "file_name"
Send the output (if not x11) to file "file_name". Default is stdout.