Credits Overview Plotting Styles Commands Terminals

save

Syntax:

      save  {functions | variables | terminal | set | fit | datablocks}
            '<filename>' {append}
      save changes '<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. The saved file contains a series of gnuplot commands in plain text that can be used as input to the load command.

save changes "savefile.gp" writes out only those functions, variables, and settings that are different from the program state at the start of the gnuplot session. This makes for a much shorter output file that should still be sufficient to allow reset session; load "savefile.gp" to recreate the current plot and program state. This command is not supported on all systems; it may not be available in your copy of gnuplot.

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'