title: pcolormesh: 'NoneType' object has no attribute 'spines'
body: <p>I want to build a figure showing 6 rasters (.tif) using pcolormesh. I calculated lat lon coordinates from the UTM coordinates using rasterio</p>
  <pre><code>with rio.open(T_files[0]) as r:
  T0 = r.transform
  p1 = Proj(r.crs)
  T = r.read()
  Turbidity = r.read(1)
  
  cols, rows = np.meshgrid(np.arange(T.shape[2]), np.arange(T.shape[1]))
  
  T1 = T0*Affine.translation(0.5,0.5)
  rc2en = lambda r, c: (c, r)*T1
  
  eastings, northings = np.vectorize(rc2en, otypes=[np.float, np.float])(rows, cols)
  
  p2 = Proj(proj='latlong', datum='WGS84')
  longs_CD, lats_CD = transform(p1, p2, eastings, northings)
  </code></pre>
  <p>This piece of code was used for each raster since they all have slightly different dimensions due to different satellite orbits. I tried to plot the figure afterwards using</p>
  <pre><code>fig1 = plt.figure(figsize=(30, 10), dpi=150)
  fig1.patch.set_alpha(1)
  #fig.add_subplot(ROW,COLUMN,POSITION)
  ax0 = plt.subplot(131, projection=ccrs.Mercator())
  ax1 = plt.subplot(132, projection=ccrs.Mercator())
  ax2 = plt.subplot(133, projection=ccrs.Mercator())
  ax3 = plt.subplot(231, projection=ccrs.Mercator())
  ax4 = plt.subplot(232, projection=ccrs.Mercator())
  ax5 = plt.subplot(233, projection=ccrs.Mercator())
  
  f0 = ax0.pcolormesh(longs_CD, lats_CD, np.ma.masked_invalid(TCD), 
                      shading='auto', transform = ccrs.PlateCarree(),
                      vmin=1, vmax=200, cmap=plt.cm.rainbow, norm=colors.LogNorm(vmin=1, vmax=200))
      
  f1 = ax1.pcolormesh(longs_ND, lats_ND, np.ma.masked_invalid(TND), 
                      shading='auto', transform = ccrs.PlateCarree(),
                      vmin=1, vmax=200, cmap=plt.cm.rainbow, norm=colors.LogNorm(vmin=1, vmax=200))
  
  f2 = ax2.pcolormesh(longs_ED, lats_ED, np.ma.masked_invalid(TED), 
                      shading='auto', transform = ccrs.PlateCarree(),
                      vmin=1, vmax=200, cmap=plt.cm.rainbow, norm=colors.LogNorm(vmin=1, vmax=200))
  
  f3 = ax3.pcolormesh(longs_CK, lats_CK, np.ma.masked_invalid(TCK), 
                      shading='auto', transform = ccrs.PlateCarree(),
                      vmin=1, vmax=200, cmap=plt.cm.rainbow, norm=colors.LogNorm(vmin=1, vmax=200))
  
  f4 = ax4.pcolormesh(longs_NK, lats_NK, np.ma.masked_invalid(TNK), 
                      shading='auto', transform = ccrs.PlateCarree(),
                      vmin=1, vmax=200, cmap=plt.cm.rainbow, norm=colors.LogNorm(vmin=1, vmax=200))
  
  f5 = ax5.pcolormesh(longs_EK, lats_EK, np.ma.masked_invalid(TEK), 
                      shading='auto', transform = ccrs.PlateCarree(),
                      vmin=1, vmax=200, cmap=plt.cm.rainbow, norm=colors.LogNorm(vmin=1, vmax=200))
  
  g1 = ax0.gridlines(draw_labels = True)
  g1.ylabels_right = None
  g1.xlabels_bottom = None
  g1.xlabel_style = {'size': 20, 'color': 'k'}
  g1.ylabel_style = {'size': 20, 'color': 'k'}
  
  g1 = ax1.gridlines(draw_labels = True)
  g1.ylabels_left = None
  g1.xlabels_bottom = None
  g1.xlabel_style = {'size': 20, 'color': 'k'}
  g1.ylabel_style = {'size': 20, 'color': 'k'}
  
  g1 = ax2.gridlines(draw_labels = True)
  g1.ylabels_left = None
  g1.xlabels_bottom = None
  g1.xlabel_style = {'size': 20, 'color': 'k'}
  g1.ylabel_style = {'size': 20, 'color': 'k'}
  
  g1 = ax3.gridlines(draw_labels = True)
  g1.ylabels_left = None
  g1.xlabels_bottom = None
  g1.xlabel_style = {'size': 20, 'color': 'k'}
  g1.ylabel_style = {'size': 20, 'color': 'k'}
  
  g1 = ax4.gridlines(draw_labels = True)
  g1.ylabels_left = None
  g1.xlabels_bottom = None
  g1.xlabel_style = {'size': 20, 'color': 'k'}
  g1.ylabel_style = {'size': 20, 'color': 'k'}
  
  g1 = ax5.gridlines(draw_labels = True)
  g1.ylabels_left = None
  g1.xlabels_bottom = None
  g1.xlabel_style = {'size': 20, 'color': 'k'}
  g1.ylabel_style = {'size': 20, 'color': 'k'}
  
  cb1 = fig1.colorbar(f1, orientation=&quot;horizontal&quot;, fraction=0.05, pad=0.07)
  cb1.set_label('mean Turbidity [FNU]', fontsize=18)
  cb1.tick_params(labelsize=20)
   
  plt.show()
  plt.clf()
  </code></pre>
  <p>Similar code snippets run usually fine for me, but this time an error: AttributeError: 'NoneType' object has no attribute 'spines'. I am pretty sure this is easy to fix but i cant figure it out. This is the complete error message</p>
  <pre><code>AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-12-ced9235ef932&gt; in &lt;module&gt;
       11 f0 = ax0.pcolormesh(longs_CD, lats_CD, np.ma.masked_invalid(TCD), 
       12                     shading='auto', transform = ccrs.PlateCarree(),
  ---&gt; 13                     vmin=1, vmax=200, cmap=plt.cm.rainbow, norm=colors.LogNorm(vmin=1, vmax=200))
       14 
       15 f1 = ax1.pcolormesh(longs_ND, lats_ND, np.ma.masked_invalid(TND), 
  
  ~\AppData\Local\Continuum\anaconda3\lib\site-packages\cartopy\mpl\geoaxes.py in wrapper(self, *args, **kwargs)
      308 
      309         kwargs['transform'] = transform
  --&gt; 310         return func(self, *args, **kwargs)
      311     return wrapper
      312 
  
  ~\AppData\Local\Continuum\anaconda3\lib\site-packages\cartopy\mpl\geoaxes.py in pcolormesh(self, *args, **kwargs)
     1559 
     1560         &quot;&quot;&quot;
  -&gt; 1561         result = self._pcolormesh_patched(*args, **kwargs)
     1562         self.autoscale_view()
     1563         return result
  
  ~\AppData\Local\Continuum\anaconda3\lib\site-packages\cartopy\mpl\geoaxes.py in _pcolormesh_patched(self, *args, **kwargs)
     1657         self.update_datalim(corners)
     1658         self.add_collection(collection)
  -&gt; 1659         self.autoscale_view()
     1660 
     1661         ########################
  
  ~\AppData\Local\Continuum\anaconda3\lib\site-packages\cartopy\mpl\geoaxes.py in autoscale_view(self, tight, scalex, scaley)
      853     def autoscale_view(self, tight=None, scalex=True, scaley=True):
      854         matplotlib.axes.Axes.autoscale_view(self, tight=tight,
  --&gt; 855                                             scalex=scalex, scaley=scaley)
      856         # Limit the resulting bounds to valid area.
      857         if scalex and self._autoscaleXon:
  
  ~\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\axes\_base.py in autoscale_view(self, tight, scalex, scaley)
     2579         handle_single_axis(
     2580             scalex, self._autoscaleXon, self._shared_x_axes, 'intervalx',
  -&gt; 2581             'minposx', self.xaxis, self._xmargin, x_stickies, self.set_xbound)
     2582         handle_single_axis(
     2583             scaley, self._autoscaleYon, self._shared_y_axes, 'intervaly',
  
  ~\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\axes\_base.py in handle_single_axis(scale, autoscaleon, shared_axes, interval, minpos, axis, margin, stickies, set_bound)
     2574             if not self._tight:
     2575                 x0, x1 = locator.view_limits(x0, x1)
  -&gt; 2576             set_bound(x0, x1)
     2577             # End of definition of internal function 'handle_single_axis'.
     2578 
  
  ~\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\axes\_base.py in set_xbound(self, lower, upper)
     3170         self.set_xlim(sorted((lower, upper),
     3171                              reverse=bool(self.xaxis_inverted())),
  -&gt; 3172                       auto=None)
     3173 
     3174     def get_xlim(self):
  
  ~\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\axes\_base.py in set_xlim(self, left, right, emit, auto, xmin, xmax)
     3338 
     3339         if emit:
  -&gt; 3340             self.callbacks.process('xlim_changed', self)
     3341             # Call all of the other x-axes that are shared with this one
     3342             for other in self._shared_x_axes.get_siblings(self):
  
  ~\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\cbook\__init__.py in process(self, s, *args, **kwargs)
      227                 except Exception as exc:
      228                     if self.exception_handler is not None:
  --&gt; 229                         self.exception_handler(exc)
      230                     else:
      231                         raise
  
  ~\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\cbook\__init__.py in _exception_printer(exc)
       79 def _exception_printer(exc):
       80     if _get_running_interactive_framework() in [&quot;headless&quot;, None]:
  ---&gt; 81         raise exc
       82     else:
       83         traceback.print_exc()
  
  ~\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\cbook\__init__.py in process(self, s, *args, **kwargs)
      222             if func is not None:
      223                 try:
  --&gt; 224                     func(*args, **kwargs)
      225                 # this does not capture KeyboardInterrupt, SystemExit,
      226                 # and GeneratorExit
  
  ~\AppData\Local\Continuum\anaconda3\lib\site-packages\cartopy\mpl\geoaxes.py in _trigger_patch_reclip(event)
     2060     axes = event.axes
     2061     # trigger the outline and background patches to be re-clipped
  -&gt; 2062     axes.spines['geo'].stale = True
     2063     axes.patch.stale = True
  
  AttributeError: 'NoneType' object has no attribute 'spines'
  </code></pre>