analysis专栏 02.数据可视化模块 09.绘制三维图
# 09.绘制三维图[toc]{type: "ol", level: [3,4,5]}### 三维图```pythonimport matplotlib.pyplot as pltimport numpy as npfrom mpl_toolkits.mplot3d import Axes3D# 创建X,Y,Z坐标X = np.random.rand(10000)Y = np.random.ran
·
# 09.绘制三维图
[toc]{type: "ol", level: [3,4,5]}
### 三维图
```python
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
# 创建X,Y,Z坐标
X = np.random.rand(10000)
Y = np.random.rand(10000)
Z = np.random.rand(10000)
fig = plt.figure()
ax = Axes3D(fig, auto_add_to_figure=False)
fig.add_axes(ax)
ax.plot_trisurf(X, Y, Z)
```
![三维图](imgs/21.png)
更多推荐
已为社区贡献16条内容
所有评论(0)