matplotlib.pyplot的contourf()
程序员文章站
2022-03-19 15:48:01
...
contourf是用来绘制三维矩阵的等高线
三个参数都分别是x轴,y轴,z轴
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(0.1,0.9, 0.2)
y = np.arange(0.1,0.9, 0.2)
z = np.eye(4)
print(z)
plt.contourf(x,y,z, alpha=.8)
plt.show()