# 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)

Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐