Book3_Elements-of-Mathematics
Book3_Elements-of-Mathematics copied to clipboard
Book3_Ch06_三维坐标系__数学要素__从加减乘除到机器学习/P7:Bk3_Ch6_01配套代码报错
Q1
运行代码,会有以下报错:
参考:https://blog.csdn.net/weixin_68148629/article/details/127384190
修改
fig.gca()为fig.add_subplot()代码可以正常运行
Q2
此外,代码中自定义函数plot_surf()里面的plt.show()函数的位置问题,导致后面的图像美化效果没有绘制出来
因此应该把plt.show()函数放到plot_surf()函数末尾
后面的代码:Bk3_Ch6_02.py、Bk3_Ch6_03.py、Bk3_Ch6_04.py、Bk3_Ch6_05.py,均有此处的Q1问题
谢谢你!是的,这个版本问题。新版本已经不支持这个语法了,需要全部修改。
Cheers, James
On Sun, Jun 4, 2023 at 5:44 AM yeqihai @.***> wrote:
后面的代码:Bk3_Ch6_02.py、Bk3_Ch6_03.py、Bk3_Ch6_04.py、Bk3_Ch6_05.py,均有此处的Q1问题
— Reply to this email directly, view it on GitHub https://github.com/Visualize-ML/Book3_Elements-of-Mathematics/issues/91#issuecomment-1575492311, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZHC6VY3DK25DLPA5K7PRALXJRKJDANCNFSM6AAAAAAYZ2BHYM . You are receiving this because you are subscribed to this thread.Message ID: <Visualize-ML/Book3_Elements-of-Mathematics/issues/91/1575492311@ github.com>
谢谢你!是的,这个版本问题。新版本已经不支持这个语法了,需要全部修改。 Cheers, James … On Sun, Jun 4, 2023 at 5:44 AM yeqihai @.***> wrote: 后面的代码:Bk3_Ch6_02.py、Bk3_Ch6_03.py、Bk3_Ch6_04.py、Bk3_Ch6_05.py,均有此处的Q1问题 — Reply to this email directly, view it on GitHub <#91 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZHC6VY3DK25DLPA5K7PRALXJRKJDANCNFSM6AAAAAAYZ2BHYM . You are receiving this because you are subscribed to this thread.Message ID: <Visualize-ML/Book3_Elements-of-Mathematics/issues/91/1575492311@ github.com>
今天也遇到了这个问题,新版本的matplolib中不支持原来的代码了。尝试了一下,目前只有上面提到的修改fig.gca(projection='3d')为ax = fig.add_subplot(projection = "3d")才能得到想要的图。(p1)
采用ax = fig.add_axes(Axes3D(fig))的方式不显示设置的title。(p2)