【错误解决】Matplotlib3 API 3.4版本变化

报错原因: 

AttributeError: 'AxesSubplot' object has no attribute 'plot_wireframe' 

官方文档: 

Extra positional parameters to plot_surface and plot_wireframe

Positional parameters to plot_surface and plot_wireframe other than XY, and Z are deprecated. Pass additional artist properties as keyword arguments instead.

链接: API Changes for 3.4.0 — Matplotlib 3.5.1 documentation

解决办法:

fig = plt.figure()
ax = fig.add_subplot(projection='3d')

ax.plot_wireframe(X, Y, Z)

你可能感兴趣的:(matplotlib)