Matplotlib (portmanteau 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 ...
, plot, and library) is a
plotting library
A library is a collection of Book, books, and possibly other Document, materials and Media (communication), media, that is accessible for use by its members and members of allied institutions. Libraries provide physical (hard copies) or electron ...
for the
Python programming language
A programming language is a system of notation for writing computer programs.
Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
and its
numerical mathematics extension
NumPy
NumPy (pronounced ) 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 predeces ...
. It provides an
object-oriented
Object-oriented programming (OOP) is a programming paradigm based on the concept of '' objects''. Objects can contain data (called fields, attributes or properties) and have actions they can perform (called procedures or methods and impleme ...
API
An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
for embedding plots into applications using general-purpose
GUI toolkit
A widget toolkit, widget library, GUI toolkit, or UX library is a library or a collection of libraries containing a set of graphical control elements (called ''widgets'') used to construct the graphical user interface (GUI) of programs.
Most wid ...
s like
Tkinter,
wxPython,
Qt, or
GTK
GTK (formerly GIMP ToolKit and GTK+) is a free software cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both Free software, free and ...
. 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 o ...
(like
OpenGL
OpenGL (Open Graphics Library) is a Language-independent specification, cross-language, cross-platform application programming interface (API) for rendering 2D computer graphics, 2D and 3D computer graphics, 3D vector graphics. The API is typic ...
), 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, fast Fourier ...
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.
Usage
Matplotlib is used in scientific research as a tool for data visualization. For example, the
Event Horizon Telescope
The Event Horizon Telescope (EHT) is a Astronomical interferometer, telescope array consisting of a global network of radio telescopes. The EHT project combines data from several very-long-baseline interferometry (VLBI) stations around Earth, wh ...
collaboration used Matplotlib to produce visualizations during the effort to create the first image of a black hole.
Matplotlib also underpins the plotting functionality of many scientific
Python libraries (for instance,
pandas uses Matplotlib as its default backend for plotting). Its importance to the scientific community has been acknowledged by institutions such as
NASA
The National Aeronautics and Space Administration (NASA ) is an independent agencies of the United States government, independent agency of the federal government of the United States, US federal government responsible for the United States ...
, which in 2024 awarded a grant to support Matplotlib’s continued development as part of an initiative to fund widely used open-source scientific software.

In education and data science, Matplotlib is frequently used to teach programming and data visualization. It integrates with
Jupyter Notebook
Project Jupyter (pronounced "Jupiter") is a project to develop open-source software, open standards, and services for interactive computing across multiple programming languages.
It was spun off from IPython in 2014 by Fernando Pérez and Bria ...
, allowing students and instructors to generate inline plots and interactively explore data within a notebook environment.
Many educational institutions incorporate Matplotlib into their curricula for teaching STEM concepts,
and it is widely featured in tutorials, workshops, and open online courses as a primary plotting library.
Related projects
*
DISLIN
DISLIN is a high-level plotting library developed by Helmut Michels at the Max Planck Institute for Solar System Research in Göttingen, Germany. Helmut Michels has worked as a mathematician and Unix system manager at the computer center of the ...
*
GNU Octave
GNU Octave is a scientific programming language for scientific computing and numerical computation. Octave helps in solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly ...
*
Plotly
Plotly is a technical computing company headquartered in Montreal, Quebec, that develops online data analytics and data visualization, visualization tools. Plotly provides online graphing, analytics, and statistics tools for individuals and colla ...
– for interactive, online Matplotlib and Python graphs
*
PLplot
PLplot is a library of subroutines that are often used to make scientific plots in compiled languages such as C, C++, D, Fortran, Ada, OCaml and Java. The library also exists as an unofficial binding for the .NET runtime. ''PLplot'' can als ...
– Python bindings available
*
SageMath
SageMath (previously Sage or SAGE, "System for Algebra and Geometry Experimentation") is a computer algebra system (CAS) with features covering many aspects of mathematics, including algebra, combinatorics, graph theory, group theory, differentia ...
– uses
Matplotlib
to draw plots
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
Free data and information visualization software