I have been trying for a long time now to make this simple basemap work. However, there is something with the format of the data basemap expects, which I cannot figure out. Can anybody help me understand what am I doing wrong?
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
from osgeo import gdal
from numpy import linspace
from numpy import meshgrid
import numpy as np
lats = [-17.96, -2.88, -3.12, -14.01, -9.28, -15.59, -15.69]
longs = [-38.69, -40.13, -40.04, -52.21, -37.89, -47.62, -41.43]
prod = [ 24.6, 7.5, 8.5, 68.8, 6.8, 6.6, 31.0]
lats = np.asarray(lats)
longs = np.asarray(longs)
prod = np.asarray(prod)
map = Basemap(projection='tmerc',
lat_0=0, lon_0=3,
llcrnrlon=1.819757266426611,
llcrnrlat=41.583851612359275,
urcrnrlon=1.841589961763497,
urcrnrlat=41.598674173123)
x = linspace(0, map.urcrnrx, prod.shape[1])
y = linspace(0, map.urcrnry, prod.shape[0])
xx, yy = meshgrid(x, y)
map.pcolormesh(xx, yy, data)
plt.show()