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

gnuplot: apply colornames from datafile

In case somebody wants to use a lookup table as @Ethan suggested, here are the 111 predefined gnuplot colors in arrays (taken from the gnuplot manual). array ColorNames[111] = \ [‘white’, ‘black’, ‘dark-grey’, ‘red’, ‘web-green’, ‘web-blue’, ‘dark-magenta’, ‘dark-cyan’, ‘dark-orange’, ‘dark-yellow’, \ ‘royalblue’, ‘goldenrod’, ‘dark-spring-green’, ‘purple’, ‘steelblue’, ‘dark-red’, ‘dark-chartreuse’, ‘orchid’, ‘aquamarine’, ‘brown’, \ ‘yellow’, ‘turquoise’, ‘grey0’, … 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