1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
x=[]
y=[]
z=[]
seed(12345)
npts = 10
Fichier = 'C:\\Temp\\donnees image defaut nettoye.txt'
Table=numpy.loadtxt(Fichier)
Table=array(Table)
for i in range((len(Table))):
x.append(Table[i][0]) # coord x
y.append(Table[i][1]) # coord y
z.append(Table[i][2]) # carte de température
x=array(x)
y=array(y)
z=array(z)
xi = np.linspace(33.70,63.94,5000)
yi = np.linspace(36.29,64.37,5000)
zi = griddata((x, y), z, (xi[None,:], yi[:,None]), method='cubic')
CS = plt.contour(xi,yi,zi,15,linewidths=0.5,colors='k')
CS = plt.contourf(xi,yi,zi,15,cmap=plt.cm.jet)
plt.colorbar()
plt.scatter(x,y,marker='o',c='b',s=5)
plt.xlim(33.70,63.94)
plt.xlabel('X')
plt.ylim(36.29,64.37)
plt.ylabel('Y')
plt.title('Carte de temperature')
plt.show() |
Partager