Key Concepts

Review core concepts you need to learn to master this subject

Pyplot functions

The Python library Matplotlib contains the pyplot module, which provides users with an interface for graphing data. Pyplot contains over 100 functions, from acorr to yticks. You must import the module, and plt is the standard variable name used.

from matplotlib import pyplot as plt

Here are some of the most common pyplot functions:

Function Description
Plot plots y versus x as lines and/or markers
Show displays a figure
Axis sets some axis properties
Xlabel sets the label for the x-axis
Ylabel sets the label for the y-axis
Title sets a title for the axes
Subplot adds a subplot to the current figure
Subplots_adjust tunes the subplot layout
Legend places a legend on the axes
Figure creates a new figure
Savefig saves the current figure
Line Graphs in Matplotlib
Lesson 1 of 3

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo