Reputation: 519
I am using the Jupyter notebook with Python 2.7. Importing matplotlib like this:
%matplotlib inline
import matplotlib.pyplot as plt
But I have observed one thing. When I use Python in Spyder I always have to use the plt.show()
command at the end of the python script in order to see the plots.
In Jupyter I do not need this command in order to see a plot. I do get this error message:
[<matplotlib.lines.Line2D at 0x91615d0>]
but it still makes a plot. Why is that?
Upvotes: 7
Views: 6416
Reputation: 7814
The requirement of adding %matplotlin inline
is no longer needed in the latest jupyter notebooks. It's a by default addition now.
You can change settings in ipython_kernel_config.py
for different behaviour
Upvotes: 2
Reputation: 85582
You turn on the immediate display with %matplotlib inline
.
The line:
[<matplotlib.lines.Line2D at 0x91615d0>]
is no error message. It is the return value of the last command. Try adding a ;
at the end of the last line to suppress this.
Upvotes: 12