- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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
- Related Articles
- Flushing all current figures in matplotlib
- How to customize spines of Matplotlib figures?
- How can I show figures separately in Matplotlib?
- Drawing multiple figures in parallel in Python with Matplotlib
- How to show two figures using Matplotlib?
- How to get the list of font family (or Name of Fonts) in Matplotlib?
- Saving all the open Matplotlib figures in one file at once
- Saving multiple figures to one PDF file in matplotlib
- How to get a list of all the fonts currently available for Matplotlib?
- How to save figures to pdf as raster images in Matplotlib?
- How to manipulate figures while a script is running in Python Matplotlib?
- How can I get the color of the last figure in Matplotlib?
- Compute the value of $x$ in each of the following figures:"
- Get the range of elements in a C# list
- Get the list of all declared fields in Java

Advertisements