1 2 3 4 5 6 7 8 9 10 11 12 13 14
| import numpy as np import matplotlib.pyplot as plt
x = np.arange(0, 10.0, 0.1) y = np.arange(0, 10.0, 0.1) X, Y = np.meshgrid(x, y) Z = X**1.5 + Y**1.5
plt.figure() CS = plt.contour(X, Y, Z, levels=6) plt.clabel(CS, inline=1, fontsize=10, fmt='%d ℃') plt.savefig('Temp.png', dpi=300, bbox_inches='tight') plt.show()
|