Thursday, August 12, 2010

Stopping Gnuplot from flashing a plot window and disappear

In Ubuntu/Debian, Gnuplot tends to use terminal 'X11' if no terminal has been defined before the 'plot' command. The reason for not specifying a terminal could be various (eg. being lazy and ignorant, subsequent use of 'replot' command using other terminal types in several other scripts)

In my case I had a loop of 5x5x5x5 times in my NS-2 script invoking Gnuplot 6 times with every run. The flashing window literally leaves the screen unusable as the Gnuplot X11 terminal window keeps popping up and out in a blink.

A temporary fix (which doesn't require rewriting my whole Gnuplot script set) is to use:
set terminal unknown
Doing this stops the flash with the first 'plot' command. The subsequent 'replot' commands can define their own terminals as needed.