Published Oct 14, 2022
Contribute to Docs

In Matplotlib, the pyplot module provides the interface for creating figures for plotting data points on the screen.


import matplotlib.pyplot as plt

The pyplot module is made available in an import statement and usually under an alias like plt.


Returns a chart/graph that represents categorical data with vertical bars.
Returns a box and whisker plot.
Creates a histogram plot that illustrates the frequency of values within a given range.
Places a legend on the axes, allowing access to manipulate parameters of the legend.
Creates a pie chart based on a given array of values.
Creates a scatter plot of x vs. y values.
Adds a given number of subplots to a matplotlib figure.

All contributors

Looking to contribute?

Learn Python:Matplotlib on Codecademy