ArticleslgStudy

computer science

Gnuplot

Gnuplot is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Gnuplot rather than just read about it. In short: gnuplot is a command-line and GUI program that can generate two- and three-dimensional plots of functions, data, and data fits. The program runs on all major computers and operating systems (Linux, Unix, Microsoft Windows, macOS, FreeDOS, and many others).

Gnuplot — main illustration
Gnuplot — illustration

Key takeaways

  • Gnuplot belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Gnuplot to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Gnuplot from memory before moving on to harder problems.

Reference excerpt

gnuplot is a command-line and GUI program that can generate two- and three-dimensional plots of functions, data, and data fits. The program runs on all major computers and operating systems (Linux, Unix, Microsoft Windows, macOS, FreeDOS, and many others). Originally released in 1986, its listed authors are Thomas Williams, Colin Kelley, Russell Lang, Dave Kotz, John Campbell, Gershon Elber, Alexander Woo "and many others." Despite its name, this software is not part of the GNU Project.

Features gnuplot can produce output directly on screen, or in many formats of graphics files, including Portable Network Graphics (PNG), Encapsulated PostScript (EPS), Scalable Vector Graphics (SVG), JPEG and many others. It is also capable of producing LaTeX code that can be included directly in LaTeX documents, making use of LaTeX's fonts and powerful formula notation abilities. The program can be used both interactively and in batch mode using scripts. Gnuplot can read data in multiple formats, including ability to read data on the fly generated by other programs (piping), create multiple plots on one image, do 2D, 3D, contour plots, parametric equations, supports various linear and non-linear coordinate systems, projections, geographic and time data reading and presentation, box plots of various forms, histograms, labels, and other custom elements on the plot, including shapes, text and images, that can be set manually, computed by script or automatically from input data. gnuplot also provides scripting capabilities, looping, functions, text processing, variables, macros, arbitrary pre-processing of input data (usually across columns), as well as the ability to perform non-linear multi-dimensional multi-set weighted data fitting (see Curve fitting and Levenberg–Marquardt algorithm). The gnuplot core code is programmed in C. Modular subsystems for output via Qt, wxWidgets, and LaTeX/TikZ/ConTeXt are written in C++ and Lua.

The code below creates the graph to the right.

The name of this program was originally chosen to avoid conflicts with a program called "newplot", and was originally a compromise between "llamaplot" and "nplot". Support of Epidemic daily and weekly formats in Version 5.4.2 is a result of pandemic Coronavirus data needs.

Distribution terms

Despite gnuplot's name, it is not named after, part of or related to the GNU Project, nor does it use the GNU General Public License. It was named as part of a compromise by the original authors, punning on gnu (the animal) and newplot (a planned name that was discarded due to already being used). Official source code to gnuplot is freely redistributable, but modified versions thereof are not. The gnuplot license allows instead distribution of patches against official releases, optionally accompanied by officially released source code. Binaries may be distributed along with the unmodified source code and any patches applied thereto. Contact information must be supplied with derived works for technical support for the modified software.

Permission to modify the software is granted, but not the right to distribute the complete modified source code. Modifications are to be distributed as patches to the released version.

Despite this restriction, gnuplot is accepted and used by many GNU packages and is widely included in Linux distributions including the stricter ones such as Debian and Fedora. The OSI Open Source Definition and the Debian Free Software Guidelines specifically allow for restrictions on distribution of modified source code, given explicit permission to distribute both patches and source code. Newer gnuplot modules (e.g. Qt, wxWidgets, and cairo drivers) have been contributed under dual-licensing terms, e.g. gnuplot + BSD or gnuplot + GPL.

GUIs and programs that use gnuplot Several third-party programs have graphical user interfaces that can be used to generate graphs using gnuplot as the plotting engine. These include:

gretl, a statistics package for econometrics JGNUPlot, a java-based GUI Kayali a computer algebra system xldlas, an old X11 statistics package gnuplotxyz, an old Windows program wxPinter, a graphical plot manager for gnuplot Maxima is a text-based computer algebra system which itself has several third-party GUIs REDUCE is a text-based computer algebra system; versions using CSL have a GUI and there are several third-party GUIs Other programs that use gnuplot include:

GNU Octave, a mathematical programming language statist, a terminal-based program gplot.pl provides a simpler command-line interface. feedgnuplot provides a plotting of stored and realtime data from a pipe ElchemeaAnalytical, an impedance spectroscopy plotting and fitting program developed by DTU Energy Gnuplot add-in for Microsoft Excel Calc, the GNU Emacs calculator

Programming and application interfaces gnuplot can be used from various programming languages to graph data, including C++ (via G3P), Perl (via PDL and other CPAN packages), Python (via gnuplotlib, Gnuplot-py and SageMath), R via (Rgnuplot), Julia (via Gaston.jl), Java (via JavaGnuplotHybrid and jgnuplot), Ruby (via Ruby Gnuplot), Ch (via Ch Gnuplot), Haskell (via Haskell gnuplot), Fortran 95, Smalltalk (Squeak and GNU Smalltalk) and Rust (via RustGnuplot). gnuplot also supports piping, which is typical of scripts. For script-driven graphics, gnuplot is one of the most popular programs.

Gnuplot output formats Gnuplot allows the user to display or store plots in several ways:

On the console, such as dumb, sixel. In a desktop window, such as Qt, wxt, X11, aquaterm, win. Embedded in a web page, such as SVG, HTML5, PNG, JPEG, animated GIF. File formats designed for document processing, such as PostScript, PDF, cgm, emf, LaTeX variants.

See also

List of graphing software

References

Further reading and external links

Gnuplot on SourceForge Gnuplot 5: an interactive ebook about gnuplot v.5. gnuplotting: a blog of gnuplot examples and tips spplotters: a blog of gnuplot examples and tips gnuplot surprising: a blog of gnuplot examples and tips gnuplot online: WebAssembly compiled online gnuplot v.5.x Philipp K. Janert (2009). Gnuplot in Action. Manning Publications. ISBN 978-1933988399. Lee Phillips (2012). gnuplot Cookbook. Packt Publishing. ISBN 978-1849517249. Williams, Thomas; Kelley, Colin (2015). Gnuplot 5.0. Samurai Media Limited. ISBN 978-988-14436-4-9. Visualize your data with gnuplot: an IBM tutorial

Illustrations

Gnuplot illustration
Gnuplot: gnuplot in interactive use
gnuplot in interactive use
Gnuplot illustration
Gnuplot illustration

Worked examples

Example 1 — a first encounter with Gnuplot

Start with the simplest possible case. Write down what Gnuplot claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Gnuplot before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Gnuplot ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Gnuplot

In research
Gnuplot appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Gnuplot in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Gnuplot is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer animation, Cross-platform free software, Data analysis software, so understanding it makes those chapters shorter.
In everyday life
Look for Gnuplot outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Gnuplot” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Gnuplot in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Gnuplot means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Gnuplot out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Gnuplot in simple terms?

gnuplot is a command-line and GUI program that can generate two- and three-dimensional plots of functions, data, and data fits. The program runs on all major computers and operating systems (Linux, Unix, Microsoft Windows, macOS, FreeDOS, and many others).

Why does Gnuplot matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Gnuplot?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Gnuplot.

Tags

  • Computer animation
  • Cross-platform free software
  • Data analysis software
  • Free 3D graphics software
  • Free educational software
  • Free mathematics software
  • Free plotting software
  • Free software programmed in C
  • Plotting software
  • Regression and curve fitting software
  • Software that uses Qt
  • Software that uses wxWidgets

Keep exploring