Generated by GPT-5-mini| Matplotlib | |
|---|---|
![]() Adrien F. Vincent · CC BY-SA 4.0 · source | |
| Name | Matplotlib |
| Developer | John D. Hunter, Michael Droettboom, Thomas Caswell, Continuum Analytics, NumFOCUS |
| Released | 2003 |
| Programming language | Python (programming language), Cython, C |
| Operating system | Linux, macOS, Microsoft Windows |
| License | Matplotlib license |
Matplotlib Matplotlib is a widely used plotting library for Python (programming language) that provides a MATLAB-like interface for creating static, interactive, and animated visualizations. Originating from work by John D. Hunter and maintained by contributors from projects such as NumPy, SciPy, and Anaconda (distribution), the library is integral to scientific computing stacks used in institutions like NASA, CERN, and companies like Google, Microsoft, Apple Inc.. Matplotlib enables publication-quality figures and integrates with GUI toolkits such as Tkinter, Qt (software), GTK.
Matplotlib began in 2002–2003 when John D. Hunter created a plotting package to emulate the plotting functionality of MATLAB for the growing NumPy user base. Early development intersected with projects like SciPy and the Python Package Index ecosystem, attracting contributors including Michael Droettboom and Thomas Caswell. Over time stewardship moved from individual maintainers to a community-backed governance model endorsed by NumFOCUS, mirroring governance changes seen in projects like Jupyter and Pandas (software). Matplotlib's development history includes major rewrites and feature additions coinciding with releases of Python 3 and integrations with libraries such as Pillow and Cycler (Python).
The architecture separates a high-level, MATLAB-like API from a lower-level object-oriented API built around objects such as Figure, Axes, and Artist, paralleling designs in GTK widget systems and concepts found in Model–View–Controller implementations in Qt (software). Rendering backends implement output to formats like PNG, PDF, SVG, and interfaces to GUI frameworks including Tkinter and wxWidgets. The core draws primitives via a renderer abstraction implemented in C and optimized with Cython, similar to performance patterns used in SciPy and scikit-learn. Style and configuration are managed through rcParams, echoing configuration strategies in Matlab and GNU Octave.
Matplotlib offers plotting primitives (line, bar, scatter, histogram), statistical graphics, and complex layouts with twin axes, inset axes, and gridspec, comparable to capabilities in ggplot2 and Plotly (company). It supports annotation, LaTeX math rendering via TeX (typesetting system), and image display with colormaps derived from perceptually uniform schemes used in ColorBrewer. Interactive features include pan/zoom tools, event handling, and animation via an animation API influenced by approaches in Processing (programming environment). Output targets encompass vector formats like PDF and SVG for publications, raster formats like PNG for web use, and backends for interactive environments including Jupyter Notebook and IPython.
Typical usage patterns pair Matplotlib with NumPy arrays or Pandas (software) DataFrame objects for data handling, reflecting workflows common at organizations such as Bloomberg, NASA, and European Space Agency. Example patterns include pyplot-based scripting resembling MATLAB code, and the object-oriented approach preferred in production codebases at companies like Netflix and research groups at MIT and Stanford University. In notebooks, Matplotlib integrates with Jupyter Notebook and JupyterLab using magic commands and inline backends; in desktop applications it embeds in GUI toolkits like Qt (software) and wxWidgets. Users create complex visual narratives combining Matplotlib with libraries such as Seaborn, Altair, and Bokeh to extend aesthetics or interactivity.
An extensive ecosystem surrounds Matplotlib, with complementary libraries like Seaborn for statistical visualization, Cartopy and Basemap for geospatial plotting, mplfinance for financial charts, and mplot3d for three-dimensional plotting. Integration adaptors connect Matplotlib to pandas.plotting and visualization grammars such as ggplot2 via porting projects. Tooling for color, themes, and layouts includes packages inspired by ColorBrewer and projects from the Python Software Foundation community. Examples of interoperable projects include scikit-image for image processing, astropy for astronomy visualization, and mayavi for volumetric rendering.
Development occurs on platforms like GitHub, with issue triage, pull requests, and continuous integration practices adopted from large open-source projects such as CPython and NumPy. Governance transitioned to a community model with oversight and fiscal sponsorship by NumFOCUS, and release management coordinated by maintainers and release managers drawn from contributors at Anaconda (distribution), Enthought, and academic labs. Matplotlib follows semantic versioning and maintains documentation and examples hosted alongside code, with contributions shaped through a contributor guide and code of conduct modeled after norms from The Linux Foundation and the Python Software Foundation. The project participates in outreach programs like Google Summer of Code to mentor new contributors.
Category:Python (programming language) libraries