As mentioned in the comments above, I would think twice about mixing Basemap and Cartopy , is there a specific reason for this? Both of them basically do the same, expanding Matplotlib with geographic capabilities. Both are valid for use, they both have their own pros and con.
In your example, you have the Basemap m axes, the Cartopy axes, and you use the Pylab interface using plt. which works with currently active axes. Perhaps this is theoretically possible, but to me it seems error prone.
I cannot change your example to make it work, because the data is missing and your code is invalid Python, for example, the indent for the function is incorrect. But here is an example with potatoes showing how you can build a Shapefile and use the same cmap/norm combination to add a color panel to the axes.
One difference of your code is that you provide the axes containing the map with the ColorbarBase functions, these must be separate axes specifically for the color bar.
import cartopy.crs as ccrs import matplotlib.pyplot as plt import matplotlib as mpl import cartopy.io.shapereader as shpreader fig, ax = plt.subplots(figsize=(12,6), subplot_kw={'projection': ccrs.PlateCarree()}) norm = mpl.colors.Normalize(vmin=0, vmax=1000000) cmap = plt.cm.RdYlBu_r for n, country in enumerate(shpreader.Reader(r'D:\ne_50m_admin_0_countries_lakes.shp').records()): ax.add_geometries(country.geometry, ccrs.PlateCarree(), facecolor=cmap(norm(country.attributes['gdp_md_est'])), label=country.attributes['name']) ax.set_title('gdp_md_est') cax = fig.add_axes([0.95, 0.2, 0.02, 0.6]) cb = mpl.colorbar.ColorbarBase(cax, cmap=cmap, norm=norm, spacing='proportional') cb.set_label('gdp_md_est')
