
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
How to show two figures using Matplotlib?
We can use the method, plt.figure(), to create the figures, and then, set their titles by passing strings as arguments.
Steps
Create a new figure, or activate an existing figure, with the window title “Welcome to figure 1”.
Draw a line using plot() method, over the current figure.
Create a new figure, or activate an existing figure, with the window title “Welcome to figure 2”.
Draw a line using plot() method, over the current figure.
Using plt.show(), show the figures.
Example
from matplotlib import pyplot as plt plt.figure("Welcome to figure 1") plt.plot([1, 3, 4]) plt.figure("Welcome to figure 2") plt.plot([11, 13, 41]) plt.show()
Output
- Related Questions & Answers
- How can I show figures separately in Matplotlib?
- How to customize spines of Matplotlib figures?
- Flushing all current figures in matplotlib
- How to save figures to pdf as raster images in Matplotlib?
- How to show Matplotlib in Flask?
- Get the list of figures in Matplotlib
- How to show two different colored colormaps in the same imshow Matplotlib?
- How to show node name in Matplotlib graphs using networkx?
- Saving multiple figures to one PDF file in matplotlib
- How to show multiple colorbars in Matplotlib?
- How to manipulate figures while a script is running in Python Matplotlib?
- Drawing multiple figures in parallel in Python with Matplotlib
- How to make Matplotlib show all X coordinates?
- How to show legend elements horizontally in Matplotlib?
- How to show mouse release event coordinates with Matplotlib?
Advertisements