Matplotlib.pyplot.get_fignums() in Python Last Updated : 12 Jul, 2025 Comments Improve Suggest changes Like Article Like Report Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, etc. matplotlib.pyplot.get_fignums() method The get_fignums() method in pyplot module of matplotlib library is used to get the list of existing figure numbers. Syntax: matplotlib.pyplot.get_fignums() Parameters: This method does not accept any parameters. Returns: This method returns the list of existing figure numbers. Below examples illustrate the matplotlib.pyplot.get_fignums() function in matplotlib.pyplot: Example 1: Python3 1== # Implementation of matplotlib function import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 10, 500) y = np.sin(x**2)+np.cos(x) plt.plot(x, y, label ='Line 1') plt.plot(x, y - 0.6, label ='Line 2') w = plt.get_fignums() plt.text(2, 1.98, "List of existing figure numbers : " + str(w), fontsize = 12) plt.title('matplotlib.pyplot.get_fignums() function\ Example', fontweight ="bold") plt.show() Output: Example 2: Python3 1== # Implementation of matplotlib function import matplotlib.pyplot as plt import numpy as np t = np.arange(0.01, 5.0, 0.01) s = np.exp(-t) plt.plot(t, s) plt.ylim(1, 0) plt.ylabel('Display Y-axis Label', fontweight ='bold') plt.grid(True) w = plt.get_fignums() plt.text(0.9, 0.58, "List of existing figure numbers : " + str(w), fontsize = 12) plt.title('matplotlib.pyplot.get_fignums() function\ Example', fontweight ="bold") plt.show() Output: Comment More infoAdvertise with us Next Article Must Coding Questions - Company-wise S shubhamsingh10 Follow Improve Article Tags : Python Python-matplotlib Matplotlib Pyplot-class Practice Tags : python Similar Reads Interview PreparationInterview Preparation For Software DevelopersMust Coding Questions - Company-wise Must Do Coding Questions - Topic-wiseCompany-wise Practice ProblemsCompany PreparationCompetitive ProgrammingSoftware Design-PatternsCompany-wise Interview ExperienceExperienced - Interview ExperiencesInternship - Interview ExperiencesPractice @GeeksforgeeksProblem of the DayTopic-wise PracticeDifficulty Level - SchoolDifficulty Level - BasicDifficulty Level - EasyDifficulty Level - MediumDifficulty Level - HardLeaderboard !!Explore More...Data StructuresArraysLinked ListStackQueueBinary TreeBinary Search TreeHeapHashingGraphAdvance Data StructuresMatrixStringAll Data StructuresAlgorithmsAnalysis of AlgorithmsSearching AlgorithmsSorting AlgorithmsPattern SearchingGeometric AlgorithmsMathematical AlgorithmsRandomized AlgorithmsGreedy AlgorithmsDynamic ProgrammingDivide & ConquerBacktrackingBranch & BoundAll AlgorithmsProgramming LanguagesCC++JavaPythonC#Go LangSQLPHPScalaPerlKotlinWeb TechnologiesHTMLCSSJavaScriptBootstrapTailwind CSSAngularJSReactJSjQueryNodeJSPHPWeb DesignWeb BrowserFile FormatsComputer Science SubjectsOperating SystemsDBMSComputer NetworkComputer Organization & ArchitectureTOCCompiler DesignDigital Elec. & Logic DesignSoftware EngineeringEngineering MathematicsData Science & MLComplete Data Science CourseData Science TutorialMachine Learning TutorialDeep Learning TutorialNLP TutorialMachine Learning ProjectsData Analysis TutorialTutorial LibraryPython TutorialDjango TutorialPandas TutorialKivy TutorialTkinter TutorialOpenCV TutorialSelenium TutorialGATE CSGATE CS NotesGate CornerPrevious Year GATE PapersLast Minute Notes (LMNs)Important Topic For GATE CSGATE CoursePrevious Year Paper: CS exams Like