- 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 to hide in IPython notebook?
To hide matplotlib.lines.Line2D instance while calling the plot() method, 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 the 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]: [] In [5]: plt.plot(x); In [6]: _ = plt.plot(x) In [7]:
Output
Out[4]: [<matplotlib.lines.Line2D at 0x7faa3852fac8>]
- Related Articles
- Automatically run %matplotlib inline in IPython Notebook
- Matplotlib animation not working in IPython Notebook?
- How to hide lines in Matplotlib?
- How to set the matplotlib figure default size in ipython notebook?
- Hide Matplotlib descriptions in Jupyter notebook
- Save figure as file from iPython notebook using Matplotlib
- Best way to display Seaborn/Matplotlib plots with a dark iPython Notebook profile
- How do I show the same Matplotlib figure several times in a single IPython notebook?
- How to dynamically update a plot in a loop in Ipython notebook?
- Plot width settings in ipython notebook\n\n
- Displaying rotatable 3D plots in IPython or Jupyter Notebook
- How to hide axes and gridlines in Matplotlib?
- How to display print statements interlaced with Matplotlib plots inline in iPython?
- How do I get interactive plots again in Spyder/Ipython/matplotlib?
- How to plot overlapping lines in Matplotlib?

Advertisements