Data Structure
 Networking
 RDBMS
 Operating System
 Java
 MS Excel
 iOS
 HTML
 CSS
 Android
 Python
 C Programming
 C++
 C#
 MongoDB
 MySQL
 Javascript
 PHP
- Selected Reading
 - UPSC IAS Exams Notes
 - Developer's Best Practices
 - Questions and Answers
 - Effective Resume Writing
 - HR Interview Questions
 - Computer Glossary
 - Who is Who
 
Get the list of figures in Matplotlib
To get the list of figures in matplotlib, we can take the following steps −
Using figure() method, create a new figure, or activate an existing figure. Creating x figures, i.e., x=3.
To get the list of figures, use the plt.get_fignums() method.
Example
from matplotlib import pyplot as plt
plt.rcParams["figure.figsize"] = [7.50, 3.50]
plt.rcParams["figure.autolayout"] = True
plt.figure()
plt.figure()
plt.figure()
print("Number of figures created: ", len(plt.get_fignums()))
plt.show()
Output
Number of figures created: 3
Advertisements