Skip to main content
 首页 » 编程设计

Python matplotlib 3d 投影错误

2024年10月01日6hnrainll

我正在尝试在 python 中打印 3d 散点图。但是当我使用这条线时 ax = fig.add_subplot(111,projection='3d') 我收到以下错误:

KeyError: u'_internal.classic_mode' 

有关完整信息,我在 macOS 上运行它,我的 matplotlib 版本是 1.1.3

请您参考如下方法:

您是否导入了 Axes3D(注意大小写)?

从 mpl_toolkits.mplot3d 导入 Axes3D

它没有明确使用,但对于 3d 投影是必需的。