Showing posts with label gnuplot. Show all posts
Showing posts with label gnuplot. Show all posts

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.

Wednesday, June 23, 2010

Gnuplot: skipping header line from input data file

The trick is in gnuplot command - "every"

The syntax of "every" is:
plot 'file' every {point_incr}
{:{block_incr}
{:{start_point}
{:{start_block}
{:{end_point}
{:end_block}}}}}

So, in order to skip the first two lines the gnuplot command would be:
plot "data.txt" using 1:5 every ::2 with linespoints linestyle 7
This will skip the first line of the data file

Wednesday, June 9, 2010

Tab, Newline and other tricks in Gnuplot graph title

Example:
plot 'data.txt' using 1:2 with lines points title sprintf("AAA vs. BBB \n (2nd line)")

Thursday, March 27, 2008

Adding more tics to gnuplot graphs


set xtic 10
set ytic 100