@@ -497,6 +497,7 @@ def standardize_2d(self, func, *args, order='C', globe=False, **kwargs):
497497 y = yi
498498 # Handle figure titles
499499 if self .figure ._auto_format :
500+ _ , colorbar_label = _auto_label (Zs [0 ], units = True )
500501 _ , title = _auto_label (Zs [0 ], units = False )
501502 if title :
502503 kw ['title' ] = title
@@ -646,7 +647,11 @@ def standardize_2d(self, func, *args, order='C', globe=False, **kwargs):
646647 kwargs ['latlon' ] = False
647648
648649 # Finally return result
649- return func (self , x , y , * Zs , ** kwargs )
650+ # WARNING: Must apply default colorbar label *here* in case metadata
651+ # was stripped by globe=True.
652+ colorbar_kw = kwargs .get ('colorbar_kw' , None ) or {}
653+ colorbar_kw .setdefault ('label' , colorbar_label )
654+ return func (self , x , y , * Zs , colorbar_kw = colorbar_kw , ** kwargs )
650655
651656
652657def _errorbar_values (data , idata , bardata = None , barrange = None , barstd = False ):
@@ -1592,7 +1597,6 @@ def cycle_changer(
15921597 f'Got { ncols } columns in data array, '
15931598 f'but { len (labels )} labels.' )
15941599 label = labels [i ]
1595- # _auto_label(iy) # e.g. a pd.Series name
15961600 values , label_leg = _auto_label (iy , axis = 1 )
15971601 if label_leg and label is None :
15981602 label = _to_array (values )[i ]
0 commit comments