matplotlib Tutorial => Creating a figure
riptutorial.com › matplotlib › exampleThe 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-created figure's ID will be incremented and used instead; figures are indexed starting from 1, not 0.