1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| import numpy as np
import matplotlib.pyplot as plt
# création de la matrice de données
Mat = [[1,2,3], [4,5,6], [7,8,9]]
Mat = np.array(Mat)
# création de la latitude
y = [-90, 0, 90]
y = np.array(y)
# création de la longitude
x = [-180, 0, 180]
x = np.array(x)
# affichage
implot = plt.imshow(Mat, extent=[x[0],x[-1],y[0],y[-1]], origin={'lower', 'lower'}, cmap='jet', interpolation='blackman')
plt.xlabel('Longitude [°]')
plt.ylabel('Latitude [°]')
plt.colorbar(label='T [K]')
plt.title('Tests')
plt.grid(linewidth=0.5, linestyle='--')
plt.show() |
Partager