|
From: Daniel J S. <dan...@ie...> - 2005-01-23 10:07:47
|
I don't know if anyone put any thought into the proper behavior of changing the terminal while some output file is still open, but current behavior seems undefined or of no use. Maybe closing the output after a terminal command is the thing to do, but I don't thing gnuplot behaves that way. This has come to my attention because in Octave I'd wondered if there was a way to leave a PostScript file or PDF file open, switch over to X11 to do some plots, switch back to the PS or PDF terminal and place another plot in the file. (Octave does stem plots as two successive plots.) In other words, in Octave this would be similar to the "print -dpdf" command but not closing the file in between plots. Anyway, back on to behavior. Try set term post color solid set output 'junk.ps' plot sin(x) set term x11 plot cos(x) set term post color solid replot set output OK, what's strange about this is that gnuplot still prints PostScript code to the file 'junk.ps' after switching to and back from "set term x11". The content of the file from the first "plot sin(x)" is erased, then the result of "replot" is sent to the file. But then there is the additional non-consistency of the PostScript file not being in color as indicated by the set term. As I said before, this is probably undefined. But I'd think a more "defined" or logical behavior would 1) The "set term" causes the output file to be closed as though a "set output" had been issued just before "set term"; or 2) The file is not actually closed and it is possible to continue to write to the file using a different terminal. If the user mixes incompatible file types, that's his or her problem to clear up. Alternative 2 would allow plotting in the x11 terminal in an intermediate fashion. Dan |