Est. 1986 Beginner

gnuplot

A portable, command-driven plotting program for producing 2D and 3D scientific and technical graphics from data and mathematical functions.

Created by Thomas Williams, Colin Kelley

Paradigm Scripting, Command-driven
Typing Dynamic, Weak
First Appeared 1986
Latest Version Version 6 series (released around late 2023)

gnuplot is a portable, command-driven program for producing 2D and 3D plots of data and mathematical functions. Despite its name, it is not part of the GNU Project; it predates the GNU coreutils and is distributed under its own permissive (non-GPL) license. For nearly four decades, it has been one of the most widely used scientific plotting tools in academia, engineering, and open-source software.

History & Origins

gnuplot was started in 1986 by Thomas Williams and Colin Kelley, who were then graduate students at the University of Illinois at Urbana-Champaign. Williams was working on differential-equations coursework and wanted an interactive way to visualize solutions; Kelley had similar needs for electronic-circuit work. The two began collaborating on a small program that could plot functions and data from a command line, and the first version was distributed via USENET.

The name “gnuplot” is, according to the authors, unrelated to the GNU Project — the “gnu” was reportedly chosen because the authors did not want to use “newplot,” which was said to be the name of a then-existing program associated with one of Williams’ advisors. The lowercase spelling (“gnuplot,” not “GNUplot”) is the project’s preferred form and helps signal the lack of GNU affiliation.

Design Philosophy

gnuplot’s design reflects priorities common to mid-1980s scientific tools:

  • Command-driven: every action is a textual command, making sessions easily reproducible as scripts.
  • Portable: a small, self-contained C codebase that compiles on a wide range of systems.
  • Terminal-driven output: plots are rendered to one of many “terminals” (output devices) — interactive windows, PostScript, PDF, PNG, SVG, LaTeX, and many more — through a single uniform interface.
  • Function-first: gnuplot can plot arbitrary mathematical expressions directly, with data files treated as a complementary input source.
  • Permissive licensing: the source can be freely used and modified, with restrictions only on how derived versions are described, allowing it to be embedded in many other tools.

The Plotting Language

gnuplot has its own small domain-specific language for describing plots, fitting curves, and processing data. Sessions can be typed interactively at a prompt or saved as .gp / .plt scripts.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Plot a function
set title "Damped Oscillation"
set xlabel "t"
set ylabel "f(t)"
plot [0:10] exp(-x/3)*cos(2*x) with lines

# Plot data from a file
set datafile separator ","
plot "data.csv" using 1:2 with linespoints title "measurements"

# 3D surface
set isosamples 50, 50
splot [-3:3][-3:3] sin(x)*cos(y) with pm3d

# Render to a file
set terminal pdfcairo size 4in,3in
set output "figure.pdf"
replot

The language includes variables, user-defined functions, conditional logic, iteration (do for, plot for), string manipulation, and built-in fitting (fit f(x) "data" via a,b,c) using the Levenberg–Marquardt algorithm.

Key Features

  • Wide range of plot styles: lines, points, impulses, boxes, histograms, error bars, filled curves, vectors, candlesticks, heatmaps, and more.
  • 3D plotting (splot): surfaces, contour lines, hidden-line removal, and pm3d color-mapped surfaces.
  • Many output terminals: interactive (qt, wxt, x11, windows, aquaterm) and file-based (pdf, svg, postscript, pngcairo, epslatex, tikz, html5).
  • Data preprocessing: column selection, filtering, smoothing (splines, bezier, csplines), and binning.
  • Curve fitting: nonlinear least-squares fitting of arbitrary user-defined functions to data.
  • Polar, parametric, and log-scaled plots built into the core language.
  • Multi-plot layouts for combining several plots into a single figure.

Evolution

Major release lines have steadily expanded gnuplot’s capabilities:

  • 1.x–2.x (late 1980s) — Core 2D plotting and a growing list of terminals.
  • 3.x (1990 onward) — Broader platform support and an expanded plotting language.
  • 4.0 (2004) — Interactive mouse/keyboard controls, improved 3D plotting, and pm3d color surfaces.
  • 4.6 (approximately 2012) — Cross-platform wxt terminal, new plot styles, and language refinements.
  • 5.0 (2015) — Major modernization: new color palettes, named colors, richer 3D, redesigned default styles, and many language improvements.
  • 5.4 (2020) — Continued polish, improved polar plots, and additional terminal options.
  • 6.x (around late 2023) — Latest series, with further enhancements to terminals, plotting styles, and the scripting language.

Current Relevance

Although newer plotting libraries — Matplotlib, ggplot2, Plotly, D3.js, and others — dominate within their respective host languages, gnuplot retains a strong niche role:

  • It remains the default or primary plotting backend for several mathematical systems, including Maxima and (historically) GNU Octave.
  • It is widely used in scientific computing pipelines, often invoked from Makefiles, shell scripts, or build systems to regenerate figures automatically.
  • It produces publication-quality output for LaTeX documents via the epslatex, cairolatex, and tikz terminals.
  • Its long history means there is an enormous body of existing scripts, tutorials, and StackExchange answers for almost any plotting task.

The project continues to be actively developed, with releases coordinated through its SourceForge project page and a small but dedicated maintainer community.

Why It Matters

gnuplot is a study in software longevity. Conceived in 1986 by two graduate students for their own use, it has outlived most of its contemporaries and continues to be relevant nearly four decades later. Its command-driven, scriptable design anticipated the modern preference for reproducible, code-defined graphics, and its terminal-abstraction model — one plotting language, many output devices — is mirrored in many later visualization libraries.

For users who need to render scientific graphics from data files with a small, portable, scriptable tool, gnuplot remains an obvious choice, and its place in the toolchain of countless researchers, engineers, and open-source projects is firmly established.

Timeline

1986
Thomas Williams and Colin Kelley begin development at the University of Illinois at Urbana-Champaign; first public release distributed to USENET
1990
Version 3.0 released, expanding terminal support and the function-plotting language
2004
Version 4.0 released, introducing major improvements including mouse and keyboard interaction with plots and improved 3D plotting
2012
Version 4.6 released (approximately), adding new terminals (including the cross-platform wxt terminal) and many language enhancements
2015
Version 5.0 released, a major overhaul adding new color palettes, named colors, improved 3D plots, and a richer plotting language
2020
Version 5.4 released, continuing improvements to terminals, polar plots, and the scripting language
2023
Version 6.0 released (late 2023), introducing new features around themes, additional plot styles, and modernized terminals

Notable Uses & Legacy

GNU Octave

Used as the historical default plotting backend for GNU Octave, providing scientific graphics for matrix and numerical computations.

Maxima

The Maxima computer algebra system uses gnuplot as a primary backend for plotting functions, surfaces, and parametric curves.

Scientific Publications

Widely used by researchers in physics, chemistry, and engineering to generate publication-quality figures in formats such as PostScript, PDF, and SVG.

gnuplot.py / Python Bindings

Various Python and other-language bindings drive gnuplot to embed plotting capability into larger applications and pipelines.

System Monitoring & Reporting

Commonly invoked from shell scripts and cron jobs to render performance graphs, logs, and statistical summaries from text data files.

Running Today

Run examples using the official Docker image:

docker pull
Last updated: