Add a single point at an existing plot

There are several possiblities to set a point/dot: 1. set object If you have simple points, like a circle, circle wedge or a square, you can use set object, which must be define before the respective plot command: set object circle at first -5,5 radius char 0.5 \ fillstyle empty border lc rgb ‘#aa1100’ lw … Read more

Hatch patterns in gnuplot

Suppose we want to pattern an area between function y=f(x) >0 and y = 0. It is posiible to create different “patterns” by using the following method. (i) Create a file that has 4 columns (x, y, xdelta, ydelta). This file describes a set of lines with the same slope. (ii) Plot data from the … Read more

Removing blank gap in gnuplot multiplot

Getting the margins right with multiplot is a bit tedious, especially when using set pm3d map, which has quite large margins. Since version 5.0 Since 5.0 version,multiplot has the options margins and spacing. margins takes four numbers set multiplot margins <left>,<right>,<bottom>,<top>, which give the fixed overall margins around the multiplot layout. spacing takes two number … Read more

Loop structure inside gnuplot?

There sure is (in gnuplot 4.4+): plot for [i=1:1000] ‘data’.i.’.txt’ using 1:2 title ‘Flow ‘.i The variable i can be interpreted as a variable or a string, so you could do something like plot for [i=1:1000] ‘data’.i.’.txt’ using 1:($2+i) title ‘Flow ‘.i if you want to have lines offset from each other. Type help iteration … Read more

Get ratio from 2 files in gnuplot

You cannot combine the data from two different files in a single using statement. You must combine the two files with an external tool. The easiest way is to use paste: plot ‘< paste a.dat b.dat’ using 1:($2/$4) with linespoints For a platform-independent solution you could use e.g. the following python script, which in this … Read more

Histogram using gnuplot?

yes, and its quick and simple though very hidden: binwidth=5 bin(x,width)=width*floor(x/width) plot ‘datafile’ using (bin($1,binwidth)):(1.0) smooth freq with boxes check out help smooth freq to see why the above makes a histogram to deal with ranges just set the xrange variable.

Gnuplot line types

Until version 4.6 The dash type of a linestyle is given by the linetype, which does also select the line color unless you explicitely set an other one with linecolor. However, the support for dashed lines depends on the selected terminal: Some terminals don’t support dashed lines, like png (uses libgd) Other terminals, like pngcairo, … Read more