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
2
votes
1 answer

fitting sub-range on time data in gnuplot

Let me start by saying that I am working on: $ gnuplot --version gnuplot 5.2 patchlevel 2 I would like to plot and fit date/time data in gnuplot and have the fit only performed and subsequently displayed on a sub-range of the plot. Example data…
Erik
  • 2,137
  • 3
  • 25
  • 42
2
votes
1 answer

Jitter points in gnuplot. Data input file format

I am able to successfully reproduce Jitter examples from here: http://gnuplot.sourceforge.net/demo/violinplot.html However, when I try to use my own data, the points are not "jittered". Here is the data file (data.dat): 10 1 1 3 8 8 8 20 2 2 3 8 8…
Oly
  • 67
  • 5
2
votes
2 answers

Stacking curves on plot/graph/canvas iteratively

With a set of data files. I would like to performs series of operations on each file (such as fitting) and stack the resulting curves continiously along with my analysis (to see how each curves fit on the bigger picture). I wrote the following code…
Many
  • 383
  • 4
  • 15
2
votes
1 answer

Continue with rest of multiplot despite 'all points Y value undefined' error in one sub-plot

In a multiplot, when I get the error all points Y value undefined for one sub-plot, how can I make gnuplot continue and output at least the remaining sub-plots? Background: Let's assume the following example time-latitude data from some GPS tracker.…
rikinet
  • 93
  • 6
2
votes
2 answers

How to tweak automatic-tics-number in gnuplot?

It is helpful that gnuplot automatically picks up reasonably good x/y-range, and x/y-tics number (say approx 5 as attached figure). However, I sometimes would like to increase/decrease the number of tics. Of course, changing number of tics is easy.…
eng27
  • 906
  • 2
  • 8
  • 19
2
votes
1 answer

gnuplot label specific y data point with x value

How can I label a datapoint on a specific y value with its corresponding x value? Extra difficulty is the x values should be in hours and not date. I have this…
Paul G.
  • 461
  • 6
  • 21
2
votes
1 answer

3D Boxes (histograms) Gnuplot with cairolatex (or epslatex)

I would like to plot 3D graphics using histograms (3D boxes) in gnuplot. However I use epslatex or cairolatex, and the demonstrations I used from the gnuplot demo site use a command: set boxdepth And this command always gives the error in my…
benjamin_ee
  • 153
  • 4
2
votes
1 answer

How resolve gnuplot artifacts in heat map

I'm trying to generate a heat map from data (https://pastebin.com/AgivvGgX). The data are not in the "matrix" form. I tried to use pm3d map and I obtained the following plot: I also tried to use dgrid3d and view map: set view map set pal def set…
Simon
  • 21
  • 2
2
votes
2 answers

convert x values to minutes or hours

assuming I have data values like those: 8.31 8.25 8.13 8.06 8.00 7.94 7.88 and it is known that they were taken 30 seconds apart each, how can I plot them as minutes or hours in the x axis? I am just confused by not having a separate time column…
Paul G.
  • 461
  • 6
  • 21
2
votes
1 answer

How to make 3D density plot based on the class of the point

I am trying to make an XYZ plot of my data points. Each data has a value associated '1' error or '0' success. My data is in this link. As a first attempt, I have used splot splot "data_all.dat" u 1:2:3:4 w points ls 1 palette title "P_{error}" The…
user1993416
  • 698
  • 1
  • 9
  • 28
2
votes
1 answer

Can gnuplot be aware of which OS is the host, other than via environment variables?

I need to develop a script in gnuplot that is usable under both Windows and Linux. To decide which OS I have, I wrote OS=system("echo %OS%") print "OS = ", OS if (OS eq "Windows_NT") \ ...; \ else \ ...; and it worked. Is there an alternative…
2
votes
1 answer

Centering labels on a pie chart

I am following this post to make a pie chart using Gnuplot. The only problem with the approach is that I can't align my percentage labels. What am I missing here? DATA FILE: "Others" 1.085117e-01 3.904323e-02 "D_o" 2.894902e-01 …
ACR
  • 81
  • 1
  • 7
2
votes
1 answer

Cumulative data and extrapolation with gnuplot

Having a list of dates and events which is not necessarily sorted by date e.g. like # Date Event 04.12.2018 -4 23.06.2018 5 04.10.2018 3 11.11.2018 -9 08.03.2018 -4 08.03.2018 2 11.11.2018 -3 I would like to sum up the events and do a (e.g.…
theozh
  • 22,244
  • 5
  • 28
  • 72
2
votes
2 answers

Printing custom label every n elements using Gnuplot

I want to create scatter plot of a file that looks like: counter N x y 1 200 50 50 2 200 46 46 3 200 56 56 4 200 36 36 5 200 56 56 There are 240 lines in this file. The N is incremented by 200 every…
begumgenc
  • 393
  • 1
  • 2
  • 12
2
votes
1 answer

How to run a shell command in Gnuplot and place the output in new file

I have the following Gnuplot: set encoding iso_8859_1 set key right bottom #font "Helvetica,17" set ylabel "Lookup error probability" font "Helvetica,17" set xlabel "Hight of the reader (m)" font "Helvetica,17" set xtics font "Helvetica,15" set…
user1993416
  • 698
  • 1
  • 9
  • 28