Streamplot python模块“ImportError:没有名为streamplot的模块”

时间:2014-11-17 02:56:59

标签: python numpy matplotlib plot

我正在尝试运行此代码,但问题是"ImportError: No module named streamplot"

请帮助解决此错误

import matplotlib.pyplot as plt
import numpy as np

from streamplot import streamplot

x = np.linspace(-3,3,100)
y = np.linspace(-3,3,100)
u = -1-x**2+y[:,np.newaxis]
v = 1+x-y[:,np.newaxis]**2

speed = np.sqrt(u*u + v*v)    
plt.figure()
plt.subplot(121)
streamplot(x, y, u, v, density=1, INTEGRATOR='RK4', color='b')
plt.subplot(122)

plt.streamplot(x, y, u, v, density=(1,1), 
               INTEGRATOR='RK4', color=u, 
               linewidth=5*speed/speed.max())

plt.show()

0 个答案:

没有答案