Credits Overview Plotting Styles Commands Terminals

save

Syntax:

      save  {functions | variables | terminal | set | fit | datablocks}
            '<filename>' {append}

If no option is specified, gnuplot saves functions, user variables, set options and the most recent plot or splot command. The current status of set term and set output is written as a comment.

Saved files are written in text format and may be read by the load command.

save terminal will write out just the terminal status, without the comment marker in front of it. This is mainly useful for switching the terminal setting for a short while, and getting back to the previously set terminal, afterwards, by loading the saved terminal status. Note that for a single gnuplot session you may rather use the other method of saving and restoring current terminal by the commands set term push and set term pop, see set term.

save variables writes all user variables but not datablocks and not internal variables GPVAL_* GPFUN_* MOUSE_* ARG*.

save fit saves only the variables used in the most recent fit command. The saved file may be used as a parameter file to initialize future fit commands using the via keyword.

The filename must be enclosed in quotes.

The special filename "-" may be used to save commands to standard output. On systems which support a popen function (Unix), the output of save can be piped through an external program by starting the file name with a '|'. This provides a consistent interface to gnuplot's internal settings to programs which communicate with gnuplot through a pipe. Please see help for batch/interactive for more details.

Examples:

      save 'work.gnu'
      save functions 'func.dat'
      save var 'state.dat'; save datablocks 'state.dat' append
      save set 'options.dat'
      save term 'myterm.gnu'
      save '-'
      save '|grep title >t.gp'