Matplotlib
   HOME

TheInfoList



OR:

Matplotlib is a plotting
library A library is a collection of materials, books or media that are accessible for use and not just for display purposes. A library provides physical (hard copies) or digital access (soft copies) materials, and may be a physical location or a vi ...
for the Python programming language and its numerical mathematics extension NumPy. It provides an
object-oriented Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of ...
API for embedding plots into applications using general-purpose
GUI toolkit The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
s like Tkinter,
wxPython wxPython is a wrapper for the cross-platform GUI API (often referred to as a "toolkit") wxWidgets (which is written in C++) for the Python programming language. It is one of the alternatives to Tkinter. It is implemented as a Python extensio ...
, Qt, or GTK. There is also a procedural "pylab" interface based on a
state machine A finite-state machine (FSM) or finite-state automaton (FSA, plural: ''automata''), finite automaton, or simply a state machine, is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number ...
(like OpenGL), designed to closely resemble that of
MATLAB MATLAB (an abbreviation of "MATrix LABoratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementat ...
, though its use is discouraged.
SciPy SciPy (pronounced "sigh pie") is a free and open-source Python library used for scientific computing and technical computing. SciPy contains modules for optimization, linear algebra, integration, interpolation, special functions, FFT, ...
makes use of Matplotlib. Matplotlib was originally written by John D. Hunter. Since then it has had an active development community and is distributed under a BSD-style license. Michael Droettboom was nominated as matplotlib's lead developer shortly before John Hunter's death in August 2012 and was further joined by Thomas Caswell. Matplotlib is a NumFOCUS fiscally sponsored project. Matplotlib 2.0.x supports Python versions 2.7 through 3.10. Python 3 support started with Matplotlib 1.2. Matplotlib 1.4 is the last version to support Python 2.6. Matplotlib has pledged not to support Python 2 past 2020 by signing the Python 3 Statement.


Comparison with MATLAB

Pyplot is a Matplotlib module that provides a MATLAB-like interface. Matplotlib is designed to be as usable as MATLAB, with the ability to use Python, and the advantage of being free and open-source.


Examples

File:Synchrotron Functions.svg, Line plot File:Matplotlib histogram v.svg, Histogram File:Matplotlib scatter v.svg, Scatter plot File:Matplotlib 3d v.svg, 3D plot File:Mpl example qbo.svg, Image plot File:Mpl example Helmoltz coils.svg, Contour plot File:Weight Growth of RN First Rate Line-of-Battle Ships 1630-1875.svg, Scatter plot File:Logarithmic Spiral Pylab.svg, Polar plot File:Temp-sunspot-co2.svg, Line plot File:Mpl example Rosenbrock function.svg, 3-D plot File:Mandelbrot set, plotted with Matplotlib.svg, Image plot


Toolkits

Several toolkits are available which extend Matplotlib functionality. Some are separate downloads, others ship with the Matplotlib
source code In computing, source code, or simply code, is any collection of code, with or without comments, written using a human-readable programming language, usually as plain text. The source code of a program is specially designed to facilitate the ...
but have external dependencies. *Basemap: map plotting with various map projections, coastlines, and political boundaries *Cartopy: a mapping library featuring object-oriented map projection definitions, and arbitrary point, line,
polygon In geometry, a polygon () is a plane figure that is described by a finite number of straight line segments connected to form a closed '' polygonal chain'' (or ''polygonal circuit''). The bounded plane region, the bounding circuit, or the two ...
and image transformation capabilities. (Matplotlib v1.2 and above) *Excel tools: utilities for exchanging data with
Microsoft Excel Microsoft Excel is a spreadsheet developed by Microsoft for Microsoft Windows, Windows, macOS, Android (operating system), Android and iOS. It features calculation or computation capabilities, graphing tools, pivot tables, and a macro (comp ...
*GTK tools: interface to the GTK library *Qt interface *Mplot3d: 3-D plots *Natgrid: interface to the natgrid library for gridding irregularly spaced data. *tikzplotlib: export to Pgfplots for smooth integration into
LaTeX Latex is an emulsion (stable dispersion) of polymer microparticles in water. Latexes are found in nature, but synthetic latexes are common as well. In nature, latex is found as a milky fluid found in 10% of all flowering plants (angiosperms ...
documents (formerly known as ''matplotlib2tikz'') * Seaborn: provides an API on top of Matplotlib that offers sane choices for plot style and color defaults, defines simple high-level functions for common statistical plot types, and integrates with the functionality provided by Pandas


Related projects

* Biggles * Chaco * DISLIN *
GNU Octave GNU Octave is a high-level programming language primarily intended for scientific computing and numerical computation. Octave helps in solving linear and nonlinear problems numerically, and for performing other numerical experiments using a lan ...
*
Gnuplot 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, ...
-py * PLplot – Python bindings available * PyChalibcairo implementation * PyPlotter – compatible with
Jython Jython is an implementation of the Python programming language designed to run on the Java platform. The implementation was formerly known as JPython until 1999. Overview Jython programs can import and use any Java class. Except for some stand ...
* SageMath – uses Matplotlib to draw plots * SciPy (modules plt and gplt) * wxPython (module wx.lib.plot.py) *
Plotly Plotly is a technical computing company headquartered in Montreal, Quebec, that develops online data analytics and visualization tools. Plotly provides online graphing, analytics, and statistics tools for individuals and collaboration, as well a ...
– for interactive, online Matplotlib and Python graphs * Bokeh – Python interactive visualization library that targets modern web browsers for presentation


References


External links

* {{SciPy ecosystem Articles with example Python (programming language) code Free plotting software Free software programmed in Python Python (programming language) scientific libraries Science software that uses GTK Science software that uses Qt