#755903 Have to invoke gnuplot with two copies of same input file

#755903#5
Date:
2014-07-24 12:17:48 UTC
From:
To:
$ gnuplot contrib.runes
$ wc -l contrib.ps
595 contrib.ps
$ gnuplot contrib.runes contrib.runes
$ wc -l contrib.ps
765 contrib.ps
$ cat contrib.runes
set terminal epscairo size 5.0, 3.5
set output 'contrib.ps'

set xrange ["1311264120":"1405958544"]
set yrange [0:800]
set xdata time
set timefmt "%s"
set style fill solid 0.5
plot 'contrib.gnuplot' using 1:2 with boxes title 'osstest loc by author date'
$

The output file from the first invocation does not actually contain
the graph data.  I have searched the whole manual for the word
`output' and nothing seems to suggest what I'm doing anything wrong.

I have seen similar effects with other `set terminal' options.  While
I haven't reproduced that systematically, I don't think this is simply
a bug in the epscairo terminal driver.

The file contrib.gnuplot is attached, as are the two .ps files.

Ian.

#755903#10
Date:
2018-11-26 15:26:01 UTC
From:
To:
This works just fine with current version of gnuplot.
I can't reproduce the problem orignally posted by Ian.
Single invocation works and produces plot with expected data.


It is possible that early implementation of the epscairo required
explicit 'unset terminal' or 'unset output' at the end to force setting
of the footer and close the file. This should happen automatically at
exit, but maybe it wasn't working.

I was not able to find anything specific in changelogs, but possibly
this change was a fix that made it finally work

2013-10-25  Thomas Bleher  <tbleher@gmx.de>

    * src/stdfn.c(gp_atexit gp_exit) src/stdfn.h src/command.c(exit_command)
    src/plot.c(main) src/qtterminal/qt_term.cpp src/win/winmain.c
    src/wxterminal/gp_cairo.c src/wxterminal/gp_cairo_helpers.c
    src/wxterminal/wxt_gui.cpp term/be.trm term/x11.trm:

    Create gnuplot atexit handlers that are called before exit(3)

    Normal atexit-handlers are called in the reverse order of registration.
    This causes problems when a library has its own global destructors which
    do not handle the case that objects of the library may still be active
    and destroyed in the atexit handler. This has been observed with Qt.

    Introduce a new function gp_exit() which calls the gnuplot atexit handlers
    and then calls exit(3). Also create gp_atexit() to register gnuplot exit
handlers.

Not sure if it was included in the 4.6.0-8 or not. Probably was, so it might
be a red hearing. And it is not really touching cairo non-wxt outputs.



Anyhow, this bug can be closed.