Tutorial by Examples

The figure contains all the plot elements. The main way to create a figure in matplotlib is to use pyplot. import matplotlib.pyplot as plt fig = plt.figure() You can optionally supply a number, which you can use to access a previously-created figure. If a number is not supplied, the last-create...
There are two main ways to create an axes in matplotlib: using pyplot, or using the object-oriented API. Using pyplot: import matplotlib.pyplot as plt ax = plt.subplot(3, 2, 1) # 3 rows, 2 columns, the first subplot Using the object-oriented API: import matplotlib.pyplot as plt fig = ...

Page 1 of 1