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
35
votes
3 answers

how to set key font size in gnuplot?

How to set key(legend) font size in gnuplot? I read the gnuplot introduction file and find no related configuration about this property. I can set font type and size for labels, tics, but only key can not be set the font?
victor
  • 655
  • 2
  • 6
  • 7
35
votes
5 answers

gnuplot conditional plotting: plot col A:col B if col C == x

How can I do this in gnuplot: plot "test.csv" using 1:2 if value_in_column_3 == 80.0 It should only select those rows where column 3 == 80.0 and ignore all other rows (It should not plot a 0 for the other rows, simply ignore them) Thanks in…
Korizon
  • 3,677
  • 7
  • 37
  • 52
34
votes
3 answers

Gnuplot: Shortest way to ignore first line in datafile

I have a .csv datafile created by another 3rd party application that should be plotted using gnuplot. Let's assume the file has the following format: 1;2;3;4;5;6 <-- This is the header line that should be ignored (with values…
Markus Weninger
  • 11,931
  • 7
  • 64
  • 137
34
votes
1 answer

gnuplot - adjust size of key/legend

How do I adjust the size of the legend in gnuplot (4.6.0)? By this I mean the size of the lines and not just the font size. When I switched from the pdf to pdfcairo terminal the size suddenly jumped and caused the key to overlap the points of…
jtlz2
  • 7,700
  • 9
  • 64
  • 114
33
votes
2 answers

Set font size of values numbers on the axis

How do I set the font size for the values on both the x and y-axis? I've looked around and I've only found ways to change the xlabel's size and ylabel's size, but I want the actual numbers below the axis to be bigger.
bb2
  • 2,872
  • 7
  • 37
  • 45
32
votes
3 answers

Line plot in GnuPlot where line color is a third column in my data file?

I have a datafile that looks like this: 1 1.0 0 2 1.5 0 3 0.0 1 4 1.2 2 5 1.0 1 6 1.1 1 where the first column is my X value, the second column is my Y value, and the third column is a color. I'd like for each line segment to be colored according…
Gabe
  • 1,081
  • 2
  • 11
  • 16
32
votes
3 answers

Can't find x11 terminal in gnuplot Octave on Mac OS

I am running Mac OS Mavericks 10.9.4. Installed Octave 3.8.1 via Homebrew which came with gnuplot 4.6 Have XQuartz 2.7.6 installed. I restarted my computer after all was done. In order to plot in octave-cli everyone states that I should just 'set…
ben39
  • 2,427
  • 4
  • 20
  • 19
31
votes
5 answers

Display underscore rather than subscript in gnuplot titles

Short question: How do I display the _ (underscore) character in a title in gnuplot that is assigned from a variable name in gnuplot? Details: I have something like the following code: items = "foo_abc foo_bcd bar_def" do for [item in items] { set…
Gabriel Southern
  • 9,602
  • 12
  • 56
  • 95
30
votes
4 answers

Plotting labeled intervals in matplotlib/gnuplot

I have a data sample which looks like this: a 10:15:22 10:15:30 OK b 10:15:23 10:15:28 OK c 10:16:00 10:17:10 FAILED b 10:16:30 10:16:50 OK What I want is to plot the above data in the following way: captions ^ | c | *------* b | *---* …
dm3
  • 2,038
  • 2
  • 17
  • 20
30
votes
9 answers

gnuplot stdin, how to plot two lines?

I'm trying to produce a plot with two lines using data taken from stdin. I have a file "test.csv": 0,1.1,2 1,2,3 2,6,4 4,4.6,5 5,5,6 I've been trying to plot this with commands like, $ cat test | gnuplot -p -e "set datafile separator \",\"; plot…
Steve
  • 8,153
  • 9
  • 44
  • 91
30
votes
1 answer

loop over array in gnuplot

This question is related to Loop structure inside gnuplot? and the answer there by DarioP. gnuplot 4.6 introduced the do command. How can I use this to loop over an array of for example files and colors? What is the correct syntax? colors = "red…
tommy.carstensen
  • 8,962
  • 15
  • 65
  • 108
30
votes
7 answers

How to plot data by c program?

I am a mechanical engineer who has only limited knowledge in C programming. I wrote some code in order to make simulations, and I want to visualize the simulation results. At the moment I am using Dev-C for writing my codes. With fopen and fprintf…
CrazyHorse
  • 309
  • 1
  • 3
  • 5
29
votes
3 answers

Fastest & most flexible way to chart over 2 million rows of flat file data?

I'm collecting some system data in a flatfile, which has this format: YYYY-MM-DD-HH24:MI:SS DD1 DD2 DD3 DD4 Where DD1-DD4 are four items of data. An example of the file is this: 2011-02-01-13:29:53 16 8 7 68 2011-02-01-13:29:58 13 8 6…
Robin Moffatt
  • 30,382
  • 3
  • 65
  • 92
28
votes
8 answers

How to create a data file for gnuplot?

I'm trying to make a graph with gnuplot. I specified my xrange, yrange, and labels, but when I typed in the following command: gnuplot> plot "data.txt" using 1:2 with lines gnuplot tells me: warning: Skipping unreadable file "data.txt" No data in…
Miriam
  • 393
  • 1
  • 3
  • 7
28
votes
4 answers

gnuplot plotting multiple line graphs

I have the following dat file, named ls.dat: # Gnuplot script file for "ls" # Version Removed Added Modified 8.1 0 0 0 8.4 0 0 4 8.5 2 5 9 8.6 2 7 51 8.7 2 7 …
Mike Kwan
  • 24,123
  • 12
  • 63
  • 96