[英]3D plot with Axes3d does not perform
When I try to plot a 3D object in pycharm I get this error: 当我尝试在pycharm中绘制3D对象时,出现此错误:
TypeError: 'module' object is not callable
code structure: 代码结构:
# visualizing data with pyplot
#usings
import numpy as np
import matplotlib.pyplot as plt
import urllib
from mpl_toolkits.mplot3d import axes3d
#main code
fig=plt.figure()
ax=axes3d(fig)
t=np.linspace(0,5*np.pi,501)
ax.plot(np.cos(t),np.sin(t),t)
plt.show()
See working code examples here . 在这里查看工作代码示例。
I exchanged the line ax=axes3d(fig)
for ax=axes3d(fig)
and it ran fine. 我将行
ax=axes3d(fig)
ax=axes3d(fig)
,它运行良好。
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d
#main code
fig=plt.figure()
ax = fig.gca(projection='3d')
t=np.linspace(0,5*np.pi,501)
ax.plot(np.cos(t),np.sin(t),t)
plt.show()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.