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

Having "automatic" x

Just a simple question (I imagine) but, lets say I have the following data file: # no x data, it's sampled for instance each second. 23 42 48 49 89 33 39 44 97 How (if possible) can I plot that as if it were 1 23 42 48 2 49 89 33 3 39 44…
user978548
  • 711
  • 2
  • 7
  • 12
27
votes
10 answers

Plotting with Octave after most recent MAC OSX update

Hi I just recently downloaded the most recent snow leopard update. Then I tried to plot something using Octave which has been installed on my computer for months (and plotting has worked all that time) Even since I installed the update, and I try…
Clark
  • 273
  • 1
  • 3
  • 4
27
votes
2 answers
26
votes
1 answer

How to concatenate strings in gnuplot?

Let's say we have two strings: String1 = 'This is ' String2 = 'a mouse.' How can I concatenate these 2 strings to form the string 'This is a mouse.' in gnuplot?
GiniPig
  • 373
  • 1
  • 3
  • 7
25
votes
3 answers

Calling functions on columns of data in Gnuplot

I have column-formatted data and I want to make a splot of the logarithm of the 5th column versus the first two columns. I have tried: set pm3d map splot "thing.file" u 1:2:log($5) But I get the error undefined value How can I get gnuplot to plot…
Dan
  • 12,157
  • 12
  • 50
  • 84
25
votes
1 answer

Pointtype command for gnuplot

I'm having trouble using the pointtype command on gnuplot. I've tried several ways such as: set pt 5 set pointtype 5 plot " " w pt 5 plot " " w pointtype 5 And for some reason nothing seems to work. I tried using the "help" feature, and apparently…
user2417813
  • 251
  • 1
  • 3
  • 3
24
votes
2 answers

How to make points one color when a third column equals zero, and another color otherwise, in Gnuplot?

I need to vary the point color for a row of values based on the color in one column. The data: # x y z 1, 3, 0 1, 5, 6 3, 5, 2 4, 5, 0 The color should be one value if the column is zero and a different color if the value in the third column…
JessicaB
  • 241
  • 1
  • 2
  • 3
24
votes
1 answer

Naming the legend entry in Gnuplot, while plotting from a data file

I am plotting a data file with six columns in gnuplot. If the plot of column 2 against column 1 is x(t), I want that line in the legend something like x(t), NOT what I currently get for column two against column one, "trial.dat" u 1:2. How would I…
user1535776
  • 599
  • 2
  • 5
  • 10
23
votes
4 answers

Short guide how to use gnuplot with python?

I'm trying to draw a graph in Python, using Gnuplot. I have a hard time finding any guide/tutorials how to start. What I'm wondering: what files/programs are necessary?(I'm using Ubuntu), Where do I begin? If anyone could recommend a good tutorial,…
Fredrik Nylund
  • 231
  • 1
  • 2
  • 4
23
votes
2 answers

How to access Gnuplot's (auto)range values and modify them to add some margin?

Using the standard plot command, I get, what I want except that the yrange is set automatically from (eg) 275 to 300. Unfortunately, I have several data points with y-coordinate 300, such that they are not visible (due to border lines, etc.). So, is…
Matthias
  • 387
  • 1
  • 2
  • 6
23
votes
1 answer

Clustered bar plot in gnuplot

I have a simple result table which I want to plot as a clustered histogram plot in gnuplot. The data set has the category of content type of a webpage and the corresponding percentage share in two columns. I have this for two browsers. For…
sfactor
  • 12,592
  • 32
  • 102
  • 152
23
votes
2 answers

How to save a graph through command line with Gnuplot?

gnuplot -p -e "plot [-4:4] exp(-x**2 / 2); set terminal png size 400,300; set output 'xyz.png'" That's what I have tried. It does create the png, but corrupted. Where am I going wrong?
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
23
votes
1 answer

If control sequence under Gnuplot

How to perform control sequences under Gnuplot please? I need to make something like if (x == nan) set xrange[] else set xrange[10:30] I tried something like ( x > 100000 ) ? (set xrange[]) : (set xrange[10:30]) ... buth without success! I…
Courier
  • 920
  • 2
  • 11
  • 36
22
votes
2 answers

Zoom out in Octave / gnuplot

I use Octave with gnuplot under Windows. I can zoom in using the right mouse button. But how can I zoom out from the UI?
Lev
  • 6,487
  • 6
  • 28
  • 29
22
votes
1 answer

In gnuplot, how to label each point in the plot with its coordinates?

I have a data file, abc.dat and I want to plot it with labeling each coordinate like (1,5), (4,6), (2,8) and so on .... abc.dat is like : 1 5 4 6 2 8 4 5 7 8 8 9 3 4
hkchakladar
  • 749
  • 1
  • 7
  • 15