- 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
How do I omit Matplotlib printed output in Python / Jupyter notebook?
To omit matplotlib printed output in Python/Jupeter notebook, we can take the following steps −
- import numpy as np.
- from matplotlib import pyplot as plt
- Create points for x, i.e., np.linspace(1, 10, 1000)
- Now, plot the line using plot() method.
- To hide the instance, use plt.plot(x); (with semi-colon)
- Or, use _ = plt.plot(x).
Example
In [1]: import numpy as np In [2]: from matplotlib import pyplot as plt In [3]: x = np.linspace(1, 10, 1000) In [4]: plt.plot(x) Out[4]: [<matplotlib.lines.Line2D at 0x7faa3852fac8>] In [5]: plt.plot(x); In [6]: _ = plt.plot(x) In [7]:
Output
Out[4]: [<matplotlib.lines.Line2D at 0x7faa3852fac8>]
- Related Articles
- Hide Matplotlib descriptions in Jupyter notebook
- Make 3D plot interactive in Jupyter Notebook (Python & Matplotlib)
- How to change the figsize for matshow() in Jupyter notebook using Matplotlib?
- Using Tkinter in Jupyter Notebook
- How to start tensorflow Docker jupyter notebook?
- How do I show the same Matplotlib figure several times in a single IPython notebook?
- Displaying rotatable 3D plots in IPython or Jupyter Notebook
- Programmatically Stop Interaction for specific Figure in Jupyter notebook
- Create a simple Numpy Jupyter Notebook using Docker
- How to display a Dataframe next to a Plot in Jupyter Notebook?
- How to show numpy 2D array as grayscale image in Jupyter Notebook?
- How do I plot a step function with Matplotlib in Python?
- How do I write a function with output parameters (call by reference) in Python?
- How do I redraw an image using Python's Matplotlib?
- Automatically run %matplotlib inline in IPython Notebook

Advertisements