mirror of
https://github.com/Estom/notes.git
synced 2026-04-05 03:48:56 +08:00
matplotlib & pandas
This commit is contained in:
28
Python/matplotlab/gallery/mplot3d/contourf3d.md
Normal file
28
Python/matplotlab/gallery/mplot3d/contourf3d.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# 填充轮廓
|
||||
|
||||
contourf与轮廓的不同之处在于它创建了填充轮廓,即。 离散数量的颜色用于遮蔽域。
|
||||
|
||||
这类似于2D中的等高线图,除了对应于等级c的阴影区域在平面z = c上绘制图形。
|
||||
|
||||

|
||||
|
||||
```python
|
||||
from mpl_toolkits.mplot3d import axes3d
|
||||
import matplotlib.pyplot as plt
|
||||
from matplotlib import cm
|
||||
|
||||
fig = plt.figure()
|
||||
ax = fig.gca(projection='3d')
|
||||
X, Y, Z = axes3d.get_test_data(0.05)
|
||||
|
||||
cset = ax.contourf(X, Y, Z, cmap=cm.coolwarm)
|
||||
|
||||
ax.clabel(cset, fontsize=9, inline=1)
|
||||
|
||||
plt.show()
|
||||
```
|
||||
|
||||
## 下载这个示例
|
||||
|
||||
- [下载python源码: contourf3d.py](https://matplotlib.org/_downloads/contourf3d.py)
|
||||
- [下载Jupyter notebook: contourf3d.ipynb](https://matplotlib.org/_downloads/contourf3d.ipynb)
|
||||
Reference in New Issue
Block a user