4

Python中的3D绘图命令~放到论文或PPT里太加分了

 2 years ago
source link: https://blog.csdn.net/L010409/article/details/123061457
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

很多情况下,为了能够观察到数据之间的内部的关系,可以使用绘图来更好的显示规律。

比如在下面的几张动图中,使用matplotlib中的三维显示命令,使得我们可以对于logistic回归网络的性能与相关参数有了更好的理解。

下面的动图显示了在训练网络时,不同的学习速率对于算法收敛之间的影响。

下面给出了绘制这些动态曲线的相关的python指令:

➤01 3D plot


1.基本语法

在安装matplotlib之后,自动安装有 mpl_toolkits.mplot3d。

2.Python Cmd

使用pythoncmd 插入相应的语句。

(1) Ex1

newCodeMoreWhite.png

▲ 3D plot的演示

(2) Ex2

newCodeMoreWhite.png

▲ 3D绘制的例子

(3) Ex3

newCodeMoreWhite.png

➤02 绘制Scatter


利用和上面的相同的绘制命令,将原来的plot3D修改成为 scatter即可。

newCodeMoreWhite.png

▲ Scatter 的例子

➤03 绘制3D Surface


(1) Ex1

▲ 3D surface例子

newCodeMoreWhite.png

▲ 3D 绘制Surface

▲ 绘制3D球表面

(2) 举例

newCodeMoreWhite.png

▲ 彩色表面绘制

这期就分享到这啦~希望对你们有帮助!喜欢的话记得个小编个三连啦~家人们的支持是小编更新最大的动力!💪

​想领取更多完整源码跟Python学习资料可点击这行


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK