@@ -5603,7 +5603,7 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
56035603 self .add_image (im )
56045604 return im
56055605
5606- def _pcolorargs (self , funcname , * args , shading = 'flat ' , ** kwargs ):
5606+ def _pcolorargs (self , funcname , * args , shading = 'auto ' , ** kwargs ):
56075607 # - create X and Y if not present;
56085608 # - reshape X and Y as needed if they are 1-D;
56095609 # - check for proper sizes based on `shading` kwarg;
@@ -5675,25 +5675,16 @@ def _pcolorargs(self, funcname, *args, shading='flat', **kwargs):
56755675 shading = 'flat'
56765676
56775677 if shading == 'flat' :
5678- if not ( ncols in ( Nx , Nx - 1 ) and nrows in ( Ny , Ny - 1 ) ):
5678+ if ( Nx , Ny ) != ( ncols + 1 , nrows + 1 ):
56795679 raise TypeError ('Dimensions of C %s are incompatible with'
56805680 ' X (%d) and/or Y (%d); see help(%s)' % (
56815681 C .shape , Nx , Ny , funcname ))
5682- if (ncols == Nx or nrows == Ny ):
5683- _api .warn_deprecated (
5684- "3.3" , message = "shading='flat' when X and Y have the same "
5685- "dimensions as C is deprecated since %(since)s. Either "
5686- "specify the corners of the quadrilaterals with X and Y, "
5687- "or pass shading='auto', 'nearest' or 'gouraud', or set "
5688- "rcParams['pcolor.shading']. This will become an error "
5689- "%(removal)s." )
5690- C = C [:Ny - 1 , :Nx - 1 ]
56915682 else : # ['nearest', 'gouraud']:
56925683 if (Nx , Ny ) != (ncols , nrows ):
56935684 raise TypeError ('Dimensions of C %s are incompatible with'
56945685 ' X (%d) and/or Y (%d); see help(%s)' % (
56955686 C .shape , Nx , Ny , funcname ))
5696- if shading in [ 'nearest' , 'auto' ] :
5687+ if shading == 'nearest' :
56975688 # grid is specified at the center, so define corners
56985689 # at the midpoints between the grid centers and then use the
56995690 # flat algorithm.
0 commit comments