pylab clobbered
In [4]:
#coding=utf-8
import numpy as np
import matplotlib as plt
%pylab inline
x1=(3,5,7)
y1=(21,39,47)
plt.scatter(x1,y1,color='gray')
Output:
Populating the interactive namespace from numpy and matplotlib
C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\magics\pylab.py:160: UserWarning: pylab import has clobbered these variables: ['plt']
`%matplotlib` prevents importing * from pylab and numpy
"\n`%matplotlib` prevents importing * from pylab and numpy"
Out[4]:
<matplotlib.collections.PathCollection at 0x7b27c18>
引入matplotlib 语句错误。
应该 import matplotlib.pyplot as plt。