From: Juergen W. <wie...@fr...> - 2005-08-18 20:09:09
|
On Wednesday 17 August 2005 14:21 Gareth Wilson wrote: > I am relatively new to gnuplot and don't pretend to know anything about its > internals but some of the behaviour has been perplexing me. I can find very > little information on the intended behaviour or philospohy of the program. That's something I'm missing, too. > In an interactive terminal (x11 in our case) this is of no consequence but > when attempting to save the output to a file (I have used both png and SVG) > the ordering is critical as the first plot command encountered outputs to > the file, not allowing subsequent replots, clearing, adding of titles etc. Think of it the following way: There are two kinds of file based terminals: those which are capable of multi-page output files and those which are not. If you do more then one plot/splot/replot command in a row with a non-multi-page terminal, the result is undefined. [If you ask me, gnuplot should issue a warning then.] And the second point is: The state of the output file is undefined as long as it isn't closed yet ("set output"). It may be valid in advance (png), and it may not (postscript). > This behaviour is not encountered by multiplots which seem to be > constructed in a temporary terminal and then output once completed > (signified by the unset multiplot). I cannot get this behaviour to be > replicated for single plots however. So the savest thing is to do: set ... ... set term ... set output "..." plot ... set output or set ... ... set term ... set output "..." set multiplot set size ... plot ... set size ... plot ... unset multiplot set output If you need a valid file while plotting, set output to a temporary file and rename it after the finishing "set output". Juergen |