Value Error; Printing out Blank Map

234 Views Asked by At

I am trying to grid plots on a map, but the grid is not showing up and I am getting a ValueError.

It says ValueError: not enough values to unpack (expected 2, got 1)

import numpy as np
import matplotlib.pyplot as plt
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
import cartopy.crs as ccrs

avglonlist=[-63.414436532479854, -63.41382404937334, -63.41320293629234, -63.4126322428388, -63.412060546875, -63.41134304470493]
avglatlist=[44.5523500343606, 44.55130764100617, 44.550250391568596, 44.54927937825529, 44.54830612909229, 44.5470865885415]
klist=['0.1243', '0.1304', '0.1321', '0.1281', '0.1358', '0.1105']

ax = plt.axes(projection=ccrs.PlateCarree())
#ax.set_extent((-65.0, -58, 40, 47.7), crs=crs_latlon)
ax.set_extent((-64.0, -61, 42.5, 45.0), crs=ccrs.PlateCarree())

#Add coastlines and meridians/parallels (Cartopy-specific).
plt.gca().coastlines('10m')
gl=ax.gridlines(crs=ccrs.PlateCarree(), draw_labels=True,
              linewidth=1, color='gray', alpha=0.5, linestyle='-')
gl.xlabels_top = False
gl.ylabels_right = False
gl.xformatter = LONGITUDE_FORMATTER
gl.yformatter = LATITUDE_FORMATTER
    # Add a title, legend, and display.
ax.set_title("Mission #13: Attenuation Coeffiecient\n2012-06-12 17:48:00 til 2012-07-08 12:10:00")

plt.pcolormesh(avglonlist, avglatlist, klist, transform=ccrs.PlateCarree())
plt.clim(0.0,0.5)
plt.show()
0

There are 0 best solutions below