Matplotlib: Difference between revisions

Content deleted Content added
m External links: Added category free data vis
Added section "Animations" containing information about matplotlib animations.
Line 25:
| website = {{URL|https://matplotlib.org}}
}}
'''Matplotlib<big>M</big>atplotlib''' is a [[Plotter|plotting]] [[Library (computer science)|library]] for the [[Python (programming language)|Python]] [[programming language]] and its [[Numerical analysis|numerical mathematics]] extension [[NumPy]]. It provides an [[Object-oriented programming|object-oriented]] [[API]] for embedding plots into applications using general-purpose [[GUI toolkit]]s like [[Tkinter]], [[wxPython]], [[Qt (software)|Qt]], or [[GTK]]. There is also a [[Procedural programming|procedural]] "pylab" interface based on a [[state machine]] (like [[OpenGL]]), designed to closely resemble that of [[MATLAB]], though its use is discouraged.<ref>{{cite web|title=API Overview|url=https://matplotlib.org/stable/api/index.html#module-pylab|publisher=matplotlib.org}}</ref> [[SciPy]] makes use of Matplotlib.
 
Matplotlib was originally written by [[John D. Hunter]]. Since then it has had an active development community<ref>{{cite web |url=https://matplotlib.org/users/github_stats.html |title=Matplotlib github stats |publisher=matplotlib.org }}</ref> and is distributed under a [[BSD licenses|BSD-style license]]. Michael Droettboom was nominated as matplotlib's lead developer shortly before John Hunter's death in August 2012<ref>{{cite web |url=http://matplotlib.1069221.n5.nabble.com/ANN-Michael-Droettboom-matplotlib-lead-developer-td5037.html |title=Announcing Michael Droettboom as the lead Matplotlib developer |publisher=matplotlib.org |access-date=2013-04-24 |archive-date=2020-10-27 |archive-url=https://web.archive.org/web/20201027122844/http://matplotlib.1069221.n5.nabble.com/ANN-Michael-Droettboom-matplotlib-lead-developer-td5037.html |url-status=dead }}</ref> and was further joined by Thomas Caswell.<ref>{{Cite news|url=https://www.numfocus.org/blog/matplotlib-lead-developer-explains-why-he-cant-fix-the-docs-but-you-can|title=Matplotlib Lead Developer Explains Why He Can't Fix the Docs—But You Can – NumFOCUS|date=2017-10-05|work=NumFOCUS|access-date=2018-04-11|language=en-US}}</ref><ref>{{Cite web|url=https://matplotlib.org/users/credits.html|title=Credits – Matplotlib 2.2.2 documentation|website=matplotlib.org|access-date=2018-04-11}}</ref> Matplotlib is a [[NumFOCUS]] fiscally sponsored project.<ref>{{cite web|title=NumFOCUS Sponsored Projects|url=https://numfocus.org/sponsored-projects|publisher=NumFOCUS|access-date=2021-10-25}}</ref>
Line 32:
Pyplot is a Matplotlib module that provides a MATLAB-like interface.<ref>{{Cite web|url=https://matplotlib.org/index.html|title=Matplotlib: Python plotting — Matplotlib 3.2.0 documentation|website=matplotlib.org|access-date=2020-03-14}}</ref> Matplotlib is designed to be as usable as MATLAB, with the ability to use Python, and the advantage of being free and [[Open source|open-source]].{{Citation needed|date=September 2023}}
 
==ExamplesPlot 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===
<gallery mode="packed">
File:Synchrotron Functions.svg|Line plot
Line 46 ⟶ 49:
File:Mandelbrot set, plotted with Matplotlib.svg|Image plot
</gallery>
 
==Animations==
Matplotlib-animation<ref>{{cite web|url=https://matplotlib.org/stable/users/explain/animations/animations.html|title=Animations using Matplotlib|publisher=matplotlib.org|accessdate=30 Aug 2024}}</ref> 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.
 
<blockquote> The time at the beginning of a frame-number since the start of animation can be calculated as - <math>\text{time} = \frac{\text{frame-number}-1}{\text{FPS}}</math></blockquote>
 
==Toolkits==