- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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
How do I show the same Matplotlib figure several times in a single IPython notebook?
To show the same Matplotlib figure several times in a single iPython notebook, we can take the following steps −
- Set the figure size and adjust the padding between and around the subplots.
- Create a figure and a set of subplots.
- Plot the data points on that axes.
- To show the current figure again, use fig.show() method.
Example
In [1]: %matplotlib auto Using matplotlib backend: Qt5Agg In [2]: import matplotlib.pyplot as plt In [3]: plt.rcParams["figure.figsize"] = [7.50, 3.50] ...: plt.rcParams["figure.autolayout"] = True In [4]: fig, ax = plt.subplots() In [5]: ax.plot([2, 4, 7, 5, 4, 1]) Out[5]: [<matplotlib.lines.Line2D at 0x7f4270361c50>] In [6]: fig.show()
Output
- Related Articles
- How to set the matplotlib figure default size in ipython notebook?
- Save figure as file from iPython notebook using Matplotlib
- Automatically run %matplotlib inline in IPython Notebook
- Matplotlib animation not working in IPython Notebook?
- How do I get interactive plots again in Spyder/Ipython/matplotlib?
- How to hide in IPython notebook?
- How do I omit Matplotlib printed output in Python / Jupyter notebook?
- Best way to display Seaborn/Matplotlib plots with a dark iPython Notebook profile
- How to dynamically update a plot in a loop in Ipython notebook?
- How to make several plots on a single page using Matplotlib?
- How do I extend the margin at the bottom of a figure in Matplotlib?
- How to make several plots on a single page using matplotlib in Python?
- Plot width settings in ipython notebook\n\n
- How to make several plots on a single page using Matplotlib(Python)?
- How to combine several matplotlib axes subplots into one figure?

Advertisements