# Introduction to Matplotlib

Matplotlib is a Python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. Matplotlib can be used in Python scripts, the Python and IPython (opens new window) shells, the Jupyter (opens new window) notebook, web application servers, and four graphical user interface toolkits.

screenshots screenshots screenshots screenshots

Matplotlib tries to make easy things easy and hard things possible. You can generate plots, histograms, power spectra, bar charts, errorcharts, scatterplots, etc., with just a few lines of code. For examples, see the sample plots (opens new window) and thumbnail gallery (opens new window).

For simple plotting the pyplot module provides a MATLAB-like interface, particularly when combined with IPython. For the power user, you have full control of line styles, font properties, axes properties, etc, via an object oriented interface or via a set of functions familiar to MATLAB users.

# Installation

Visit the Matplotlib installation instructions.

# Documentation

This is the documentation for Matplotlib version 3.1.1.

To get started, read the User's Guide (opens new window).

Other versions are available:

Trying to learn how to do a particular kind of plot? Check out the examples gallery (opens new window) or the list of plotting commands (opens new window).

# Other learning resources

There are many external learning resources (opens new window) available including printed material, videos and tutorials.

# Need help?

Matplotlib is a welcoming, inclusive project, and we follow the Python Software Foundation Code of Conduct (opens new window) in everything we do.

Check the FAQ and the API docs.

For help, join the gitter channel (opens new window) and the matplotlib-users (opens new window), matplotlib-devel (opens new window), and matplotlib-announce (opens new window) mailing lists, or check out the Matplotlib tag on stackoverflow (opens new window). The search tool searches all of the documentation, including full text search of over 350 complete examples which exercise almost every corner of Matplotlib.

You can file bugs, patches and feature requests on the issue tracker (opens new window), but it is a good idea to ping us on the mailing list too.

To keep up to date with what's going on in Matplotlib, see the what's new page or browse the source code (opens new window). Anything that could require changes to your existing code is logged in the API changes file.

# Toolkits

Matplotlib ships with several add-on toolkits, including 3d plotting with mplot3d, axes helpers in axes_grid1 and axis helpers in axisartist.

# Third party packages

A large number of third party packages extend and build on Matplotlib functionality, including several higher-level plotting interfaces (seaborn (opens new window), holoviews (opens new window), ggplot (opens new window), ...), and two projection and mapping toolkits (basemap (opens new window) and cartopy (opens new window)).

# Citing Matplotlib

Matplotlib is the brainchild of John Hunter (1968-2012), who, along with its many contributors, have put an immeasurable amount of time and effort into producing a piece of software utilized by thousands of scientists worldwide.

If Matplotlib contributes to a project that leads to a scientific publication, please acknowledge this work by citing the project. A ready-made citation entry is available.

# Open source

Matplotlib is a Sponsored Project of NumFOCUS, a 501(c)(3) nonprofit charity in the United States. NumFOCUS provides Matplotlib with fiscal, legal, and administrative support to help ensure the health and sustainability of the project. Visit numfocus.org for more information.

Donations to Matplotlib are managed by NumFOCUS. For donors in the United States, your gift is tax-deductible to the extent provided by law. As with any donation, you should consult with your tax adviser about your particular tax situation.

Please consider donating to the Matplotlib project (opens new window) through the Numfocus organization or to the John Hunter Technology Fellowship (opens new window).

The Matplotlib license is based on the Python Software Foundation (PSF) license (opens new window).

There is an active developer community and a long list of people who have made significant contributions.

Matplotlib is hosted on Github (opens new window). Issues (opens new window) and Pull requests (opens new window) are tracked at Github too.