gnuplot

From Infogalactic: the planetary knowledge core
Jump to: navigation, search
gnuplot
File:Gnuplot ellipsoid.svg
3D rendering of an ellipsoid by gnuplot
Initial release 1986
Stable release 5.0.1 (June 7, 2015; 8 years ago (2015-06-07)) [±]
Preview release 5.0.rc2 (August 28, 2014; 9 years ago (2014-08-28)) [±]
Development status Active
Written in C
Platform Cross-platform
Type Plotting
License Free software (own license)[1]
Website www.gnuplot.info

gnuplot is a command-line program that can generate two- and three-dimensional plots of functions, data, and data fits. It is frequently used for publication-quality graphics as well as education. The program runs on all major computers and operating systems (GNU/Linux, Unix, Microsoft Windows, Mac OS X, and others). It is a program with a fairly long history, dating back to 1986. Despite its name, this software is not distributed under the GNU General Public License (GPL), but its own free software license.[1]

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.

The program is well supported and documented. Extensive help can also be found on the Internet.[2][3]

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.

gnuplot in interactive use.

The code below creates the graph to the right.

set title "Some math functions"
set xrange [-10:10]
set yrange [-2:2]
set zeroaxis
plot (x/4)**2, sin(x), 1/x
Sample Video
A scatter plot of samples from a text file. 
Thousands of dots plotted, forming a pattern
A logarithmic spiral. 

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".[4]

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.[5]

Official source code to gnuplot is freely redistributable, but modified versions thereof are not. The gnuplot license instead recommends 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.[1]

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:

Maxima is a text-based computer algebra system which itself has several third-party GUIs.

Other programs that use gnuplot include:

  • GNU Octave, a mathematical programming language
  • statist, a terminal-based program[11]
  • gplot.pl provides a simpler command-line interface.[12]

Programming and application interfaces

gnuplot can be used from various programming languages to graph data, including Perl (via CPAN), Python (via Gnuplot-py and SAGE), Julia (via Gaston.jl), Java (via JavaGnuplotHybrid and jgnuplot), Ruby (via Ruby Gnuplot), Ch (via Ch Gnuplot), Haskell (via Haskell gnuplot) and Smalltalk (Squeak and GNU Smalltalk).

gnuplot also supports piping, which is typical of scripts.[13] For script-driven graphics, gnuplot is by far the most popular program.[citation needed]

Alternatives

<templatestyles src="Module:Hatnote/styles.css"></templatestyles>

Programmatic alternatives

Pyxplot (Home page) is a free plotting program that has a very similar syntax but tries to enhance gnuplot's data processing and scripting capabilities.

Application programs could be linked with a graphics library such as:

Graphical alternatives

For interactive plotting through a graphical user interface (GUI), the following open-source programs are available:

  • Plotly – publication quality, browser-based graphing library for R, Python, MATLAB, Julia, and Perl; also features a styling GUI.
  • QtiPlot – inspired by the proprietary program Origin
  • SciDAVis – a fork of QtiPlot
  • LabPlot – project merged with SciDAVis
  • HippoDraw
  • Veusz – a GUI which also supports Python plugins
  • Graph - high quality, easy to use, popular with students for plotting data and functions and curve fitting (Windows only). www.padowan.dk

See also

References

  1. 1.0 1.1 1.2 Lua error in package.lua at line 80: module 'strict' not found.
  2. Lua error in package.lua at line 80: module 'strict' not found.
  3. Lua error in package.lua at line 80: module 'strict' not found.
  4. Gnuplot FAQ
  5. Lua error in package.lua at line 80: module 'strict' not found.
  6. http://jgp.sourceforge.net/
  7. http://kayali.sourceforge.net/index.htm
  8. http://linux.maruhn.com/sec/xldlas.html
  9. http://www.uni-hamburg.de/Wiss/FB/15/Sustainability/schneider/gnuplot/
  10. Lua error in package.lua at line 80: module 'strict' not found.
  11. http://wald.intevation.org/projects/statist/
  12. http://gplot.sourceforge.net/
  13. Piping to GNU Plot from C by Amit Saha

Further reading and external links