Questions tagged [gnuplot]

Gnuplot is a portable command-line driven graphing utility for linux, OS/2, MS Windows, OSX, VMS, and many other platforms. Use this tag for questions about programmatic use of Gnuplot; debugging interactive usage is off-topic.

Gnuplot is a command-line driven plotting engine that runs on all major operating systems (Windows, GNU/Linux, OSX, etc.). Its initial release dates back to 1986 and it is still being actively developed. The program is written in and is released under a custom open source license.

Gnuplot provides a large array of styles to produce different plots including plots popular in mathematics, statistics, or even financial analysis. It can also produce various plot styles for three dimensional data including surface and contour plots. It is capable of plotting user defined functions or specific data and can even generate data through various facilities if needed.

There is no graphical user interface contained in the official release, but several external ones are available (e.g. wgnuplot, xgfe, PlotDrop,...). Additionally there are interfaces available for multiple programming languages such as C, , , and (see more information in links below). There are several software suites that use Gnuplot as plotting device. Amongst them are GNU , and . Mostly however, Gnuplot is used via scripts which automate the task of generating graphics.

Gnuplot produces output using custom output devices called terminals which are available for interactive use, most popular raster formats, various vector formats (including SVG), and both postscript and pdf. Terminals are even available for various LaTeX package formats for direct inclusion into LaTeX documents allowing the document processor to do the typesetting of figure annotations or having the annotations done by gnuplot itself.

Gnuplot is a powerful tool as it allows the customization of nearly every parameter of the plot. Recent versions even support limited but powerful programming features including command line arguments for scripts, conditional and looping statements, and the ability to do smoothing or basic statistical calculations on data.

Gnuplot demos

enter image description here enter image description here

Links

Gnuplot Blogs

Gnuplot Books

6701 questions
53
votes
4 answers

Gnuplot date/time in x axis

I have a quick question regarding dates and times in x-axis in GNUPLOT. I'll let the code do the talking: This is my data: #Time Data in Data out "2013-07-22 15:59:00" 6286 3730 "2013-07-22 15:58:00" 10695 14589 "2013-07-22 15:57:00" …
Jose Salvatierra
  • 2,407
  • 6
  • 21
  • 41
48
votes
5 answers

Gnuplot plotting data from a file up to some row

I have data in some text file which has let's say 10000 rows and 2 columns. I know that I can plot it easily by plot "filename.txt" using 1:2 with lines . What I want is however just plotting let's say the rows from 1000 to 2000 or any other…
jkt
  • 2,538
  • 3
  • 26
  • 28
41
votes
5 answers

How do I draw a set of vertical lines in gnuplot?

E.g. if I have a graph and want to add vertical lines at every 10 units along the X-axis.
agam
  • 5,064
  • 6
  • 31
  • 37
40
votes
1 answer

Gnuplot x-axis resolution

I'm trying to plot in gnuplot a log-periodic function: cos((log(abs(t-Tc))*PI/log10(lambda) ) + phi) But because of the nature of log(x) near to x=0, the plot is getting ugly. How to plot a log-periodic function in gnuplot so it looks nice? My plot…
czerasz
  • 13,682
  • 9
  • 53
  • 63
39
votes
6 answers

pipe plot data to gnuplot script

I want to create a gnuplot with three plots in it. The data should be inline (as I want to only It should look like this: Currently I am using the following gnuplot script to create the plot: set terminal png set output "test.png" plot…
user524824
39
votes
2 answers

gnuplot: plotting a file with 4 columns all on y-axis

I have a file that contains 4 numbers (min, max, mean, standard derivation) and I would like to plot it with gnuplot. Sample: 24 31 29.0909 2.57451 12 31 27.2727 5.24129 14 31 26.1818 5.04197 22 31 27.7273 3.13603 22 31 28.1818 2.88627 If I have 4…
user1777907
  • 1,355
  • 4
  • 12
  • 28
39
votes
6 answers

Good plotting library for C?

My question is very similar in spirit to this question: What is the best plotting library for Python? What is my best bet for plotting data in C? Am I better off forgoing a library and just generating data that I can feed directly into gnuplot? My…
Kevin L.
  • 4,548
  • 7
  • 39
  • 54
38
votes
3 answers

gnuplot - removing line title

I tried searching, but I couldn't find the solution for this particular condition. In my plot , I am comparing two traces. I am using a line graph and both traces are plotted with different colors. plot "delay_try1.dat" using 1:2 title 'With…
sethu
  • 1,691
  • 4
  • 22
  • 34
38
votes
6 answers

How to plot data without a separate file by specifying all points inside the Gnuplot script?

My program generates bash scripts that call gnuplot. I don't want to have to make an extra file to store the data; is there any way I can explicitly call all of the values? Or possibly having bash make a temporary file. Something like plot…
rhombidodecahedron
  • 7,693
  • 11
  • 58
  • 91
38
votes
2 answers

Plotting two axes in gnuplot

Is it possible to plot two curves, with two corresponding axes in gnuplot, each of which has a different scale? For example, y=x**2 and y=x**4 in the same graph (they vary enough to be "uncomfortable" when plotted with the same scale).
Rook
  • 60,248
  • 49
  • 165
  • 242
37
votes
2 answers

gnuplot: how to use a*(10^b) format on axis

I am using really big numbers (milions) on my x-axis, so when I use set format x %6.0f I got big numbers like 25000000. That is quite nice, but takes much space, so there are only few labels and reader losts information. When I exclude setting…
Perlnika
  • 4,796
  • 8
  • 36
  • 47
37
votes
6 answers

Install gnuplot 5.0.1 on OSX

I downloaded the source files for gnuplot 5.0.1 (gnuplot-5.0.1.tar.gz) from the source forge page. I also installed the Command Line Tools on my OS X 10.7.5 so that I have gcc and make in the /usr/bin folder. I followed the installation…
dada
  • 1,390
  • 2
  • 17
  • 40
36
votes
3 answers

How to set equal scale's length in gnuplot

Hi Is it possible in gnuplot to set scales so that length of scaleX and scaleY would be the same?? I tried different tricks (set size, set ratio etc) but even if the range of scaleX and scaleY is the same - the length of that scales are different.…
nina
  • 431
  • 2
  • 5
  • 5
36
votes
7 answers

Choosing line type and color in Gnuplot 4.0

I have two pairs of datasets, which I need to plot using Gnuplot. I want the first pair to be plotted in red, one solid and one dashed. The second pair, I want to plot in blue, one solid and one dashed. I've experimented with set style line several…
Escualo
  • 40,844
  • 23
  • 87
  • 135
36
votes
5 answers

How to plot several datasets with titles from one file in Gnuplot?

Assuming I have a file that looks like this (note the double newlines): "p = 0.1" 1 1 3 3 4 1 "p = 0.2" 1 3 2 2 5 2 Is it possible to make Gnuplot plot these two datasets in one plot with the titles given on the first line of each dataset?
gTcV
  • 2,446
  • 1
  • 15
  • 32