Matplotlib

Last updated
Matplotlib
Original author(s) John D. Hunter
Developer(s) Michael Droettboom, et al.
Initial release2003;21 years ago (2003) [1]
Stable release
3.9.2 [2]   OOjs UI icon edit-ltr-progressive.svg / 13 August 2024;3 months ago (13 August 2024)
Repository
Written in Python
Engine Cairo, Anti-Grain Geometry
Operating system Cross-platform
Type Plotting
License Matplotlib license
Website matplotlib.org

Matplotlib (portmanteau of MATLAB, plot, and library [3] ) is a plotting library for the Python programming language and its numerical mathematics extension NumPy. It provides an object-oriented API for embedding plots into applications using general-purpose GUI toolkits like Tkinter, wxPython, Qt, or GTK. There is also a procedural "pylab" interface based on a state machine (like OpenGL), designed to closely resemble that of MATLAB, though its use is discouraged. [4] SciPy makes use of Matplotlib.

Contents

Matplotlib was originally written by John D. Hunter. Since then it has had an active development community [5] 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 [6] and was further joined by Thomas Caswell. [7] [8] Matplotlib is a NumFOCUS fiscally sponsored project. [9]

Comparison with MATLAB

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

Plot Types

Matplotlib supports various types of 2 dimensional and 3 dimensional plots. The support for two dimensional plots is robust. The support for three dimensional plots was added later and while it is good, it is not as robust as 2 dimensional plots.

Examples

Animations

Matplotlib-animation [11] capabilities are intended for visualizing how certain data changes. However, one can use the functionality in any way required.

These animations are defined as a function of frame number (or time). In other words, one defines a function that takes a frame number as input and defines/updates the matplotlib-figure based on it.

The time at the beginning of a frame-number since the start of animation can be calculated as -

Toolkits

Several toolkits are available which extend Matplotlib functionality. Some are separate downloads, others ship with the Matplotlib source code but have external dependencies. [12]

Related Research Articles

<span class="mw-page-title-main">SciPy</span> Open-source Python library for scientific computing

SciPy is a free and open-source Python library used for scientific computing and technical computing.

<span class="mw-page-title-main">NumPy</span> Python library for numerical programming

NumPy is a library for the Python programming language, adding support for large, multi-dimensional arrays and matrices, along with a large collection of high-level mathematical functions to operate on these arrays. The predecessor of NumPy, Numeric, was originally created by Jim Hugunin with contributions from several other developers. In 2005, Travis Oliphant created NumPy by incorporating features of the competing Numarray into Numeric, with extensive modifications. NumPy is open-source software and has many contributors. NumPy is a NumFOCUS fiscally sponsored project.

<span class="mw-page-title-main">PyGTK</span> Set of Python wrappers for the GTK graphical user interface library

PyGTK is a set of Python wrappers for the GTK graphical user interface library. PyGTK is free software and licensed under the LGPL. It is analogous to PyQt/PySide and wxPython, the Python wrappers for Qt and wxWidgets, respectively. Its original author is GNOME developer James Henstridge. There are six people in the core development team, with various other people who have submitted patches and bug reports. PyGTK has been selected as the environment of choice for applications running on One Laptop Per Child systems.

<span class="mw-page-title-main">ROOT</span> Data analysis software

ROOT is an object-oriented computer program and library developed by CERN. It was originally designed for particle physics data analysis and contains several features specific to the field, but it is also used in other applications such as astronomy and data mining. The latest minor release is 6.32, as of 2024-05-26.

<span class="mw-page-title-main">IPython</span> Advanced interactive shell for Python

IPython is a command shell for interactive computing in multiple programming languages, originally developed for the Python programming language, that offers introspection, rich media, shell syntax, tab completion, and history. IPython provides the following features:

<span class="mw-page-title-main">SymPy</span> Python library for symbolic computation

SymPy is an open-source Python library for symbolic computation. It provides computer algebra capabilities either as a standalone application, as a library to other applications, or live on the web as SymPy Live or SymPy Gamma. SymPy is simple to install and to inspect because it is written entirely in Python with few dependencies. This ease of access combined with a simple and extensible code base in a well known language make SymPy a computer algebra system with a relatively low barrier to entry.

Enthought, Inc. is a software company based in Austin, Texas, United States that develops scientific and analytic computing solutions using primarily the Python programming language. It is best known for the early development and maintenance of the SciPy library of mathematics, science, and engineering algorithms and for its Python for scientific computing distribution Enthought Canopy.

<span class="mw-page-title-main">Cython</span> Programming language

Cython is a superset of the programming language Python, which allows developers to write Python code that yields performance comparable to that of C.

scikit-learn Python library for machine learning

scikit-learn is a free and open-source machine learning library for the Python programming language. It features various classification, regression and clustering algorithms including support-vector machines, random forests, gradient boosting, k-means and DBSCAN, and is designed to interoperate with the Python numerical and scientific libraries NumPy and SciPy. Scikit-learn is a NumFOCUS fiscally sponsored project.

<span class="mw-page-title-main">Spyder (software)</span> IDE for scientific programming in Python

Spyder is an open-source cross-platform integrated development environment (IDE) for scientific programming in the Python language. Spyder integrates with a number of prominent packages in the scientific Python stack, including NumPy, SciPy, Matplotlib, pandas, IPython, SymPy and Cython, as well as other open-source software. It is released under the MIT license.

pandas (software) Python library for data analysis

Pandas is a software library written for the Python programming language for data manipulation and analysis. In particular, it offers data structures and operations for manipulating numerical tables and time series. It is free software released under the three-clause BSD license. The name is derived from the term "panel data", an econometrics term for data sets that include observations over multiple time periods for the same individuals, as well as a play on the phrase "Python data analysis". Wes McKinney started building what would become Pandas at AQR Capital while he was a researcher there from 2007 to 2010.

<span class="mw-page-title-main">Plotly</span> Canadian computing company

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 as scientific graphing libraries for Python, R, MATLAB, Perl, Julia, Arduino, JavaScript and REST.

John D. Hunter was an American neurobiologist and the original author of Matplotlib.

<span class="mw-page-title-main">Dask (software)</span> Python library for parallel computing

Dask is an open-source Python library for parallel computing. Dask scales Python code from multi-core local machines to large distributed clusters in the cloud. Dask provides a familiar user interface by mirroring the APIs of other libraries in the PyData ecosystem including: Pandas, scikit-learn and NumPy. It also exposes low-level APIs that help programmers run custom algorithms in parallel.

CuPy is an open source library for GPU-accelerated computing with Python programming language, providing support for multi-dimensional arrays, sparse matrices, and a variety of numerical algorithms implemented on top of them. CuPy shares the same API set as NumPy and SciPy, allowing it to be a drop-in replacement to run NumPy/SciPy code on GPU. CuPy supports Nvidia CUDA GPU platform, and AMD ROCm GPU platform starting in v9.0.

References

  1. "Copyright Policy".
  2. "Release 3.9.2". 13 August 2024. Retrieved 22 August 2024.
  3. https://matplotlib.org/stable/project/history.html
  4. "API Overview". matplotlib.org.
  5. "Matplotlib github stats". matplotlib.org.
  6. "Announcing Michael Droettboom as the lead Matplotlib developer". matplotlib.org. Archived from the original on 2020-10-27. Retrieved 2013-04-24.
  7. "Matplotlib Lead Developer Explains Why He Can't Fix the Docs—But You Can – NumFOCUS". NumFOCUS. 2017-10-05. Retrieved 2018-04-11.
  8. "Credits – Matplotlib 2.2.2 documentation". matplotlib.org. Retrieved 2018-04-11.
  9. "NumFOCUS Sponsored Projects". NumFOCUS. Retrieved 2021-10-25.
  10. "Matplotlib: Python plotting — Matplotlib 3.2.0 documentation". matplotlib.org. Retrieved 2020-03-14.
  11. "Animations using Matplotlib". matplotlib.org. Retrieved 30 Aug 2024.
  12. "Toolkits". matplotlib.org.
  13. Whitaker, Jeffrey. "The Matplotlib Basemap Toolkit User's Guide (v. 1.0.5)". Matplotlib Basemap Toolkit documentation. Retrieved 24 April 2013.
  14. Elson, Philip. "Cartopy" . Retrieved 24 April 2013.
  15. Schlömer, Nico. "tikzplotlib". GitHub . Retrieved 7 November 2016.
  16. "GeoPandas 0.14.4 — GeoPandas 0.14.4+0.g60c9773.dirty documentation". geopandas.org. Retrieved 2024-04-29.
  17. Jordahl, Kelsey, geopandas: Geographic pandas extensions , retrieved 2024-04-29
  18. "Using cartopy with matplotlib — cartopy 0.15.0 documentation". scitools.org.uk. Retrieved 2024-04-30.
  19. "Bigglessimple, elegant python plotting". biggles.sourceforge.net. Retrieved 24 November 2010.
  20. "Chaco". code.enthought.com.
  21. "Gnuplot.py on". gnuplot-py.sourceforge.net. Retrieved 24 November 2010.
  22. "Bokeh 2.0.0 Documentation". docs.bokeh.org. Retrieved 2020-03-14.