Cannot display inline chart in IPython notebook

2019-08-24 17:23发布

I've seen the exact same question around but the answers didn't help me. like those questions: Cannot show the graphs on ipython notebook

How to make IPython notebook matplotlib plot inline

So I decided to post a question so i could post my code, see if there is anything different... hopefully it's something very dull that I'm missing. although the code runs perfectly in ipython shell. Thanks in advance !

%matplotlib inline

import matplotlib
import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(0, 3*np.pi, 500)
plt.plot(x, np.sin(x**2))
plt.title('A simple chirp')
plt.show()

PS: I'm using Anaconda distribution, and I launched notebook by the shortcut that comes with it IPython (Python 2.7) Notebook

PS2: the output I get is virtually none.

enter image description here

0条回答
登录 后发表回答