#393 "save" to record the actual last filename

Karl Ratzsch

If the last plot was done using "" as shorthand for the previous file name, the saved plot only contains the "", there´s no hint as to what file was actually printed.

There could be a GPVAL_ variable that contains the actual name, and gets saved.

The handling of that variable upon loading and it´s use for further plots might raise a backwards compatibility issue, however.


  • Ethan Merritt
    Ethan Merritt

    From "help plot special-filename"

    The empty filename '' tells gnuplot to re-use the previous input file in the
    same plot command. So to plot two columns from the same input file:

       plot 'filename' using 1:2, '' using 1:3

    Thus the scope of the empty quotes is only a single plot command, and the filename
    is right there at the front of that command.

    It may be that the string holding the name is not explictly cleared out everywhere
    it should be (bug?), so that it is sometimes still set for a later plot command.
    But that was not the intent and is contrary to the documentation. Certainly
    you should not depend on it.

  • Karl Ratzsch
    Karl Ratzsch

    Oh. Right. ;-)

    But reusing the filename with "" over subsequent plot commands has always worked, ever since i first used gnuplot > 10 years ago. Couldn´t we just promote this from "bug" to "feature"? It´s damn useful, saves quite some typing.