Credits Overview Plotting Styles Commands Terminals

output

Syntax:

      set output {"<filename>"}
      unset output
      show output

Graphs produced by non-interactive terminals are by default sent to stdout. The set output command redirects output to the specified file or device. The file opened by this command remains open until a subsequent set/unset output command, a change in terminal type, or exit from gnuplot.

Interactive terminals ignore set output.

The filename must be enclosed in quotes. If the filename is omitted, the command is equivalent to unset output; any output file opened by a previous set output will be closed and new output will be sent to stdout.

When both set terminal and set output are used together, it is safest to give set terminal first, because some terminals set a flag which is needed in some operating systems. This would be the case, for example, if the operating system needs a separate open command for binary files.

On platforms that support pipes, it may be useful to pipe terminal output. For instance,

      set output "|lpr -Plaser filename"
      set term png; set output "|display png:-"

On MSDOS machines, set output "PRN" directs output to the default printer.