@@ -5173,20 +5173,14 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
51735173 return im
51745174
51755175 @staticmethod
5176- def _pcolorargs (funcname , * args , ** kw ):
5177- # This takes one kwarg, allmatch.
5178- # If allmatch is True, then the incoming X, Y, C must
5179- # have matching dimensions, taking into account that
5180- # X and Y can be 1-D rather than 2-D. This perfect
5181- # match is required for Gouroud shading. For flat
5182- # shading, X and Y specify boundaries, so we need
5183- # one more boundary than color in each direction.
5184- # For convenience, and consistent with Matlab, we
5185- # discard the last row and/or column of C if necessary
5186- # to meet this condition. This is done if allmatch
5187- # is False.
5188-
5189- allmatch = kw .pop ("allmatch" , False )
5176+ def _pcolorargs (funcname , * args , allmatch = False ):
5177+ # If allmatch is True, then the incoming X, Y, C must have matching
5178+ # dimensions, taking into account that X and Y can be 1-D rather than
5179+ # 2-D. This perfect match is required for Gouroud shading. For flat
5180+ # shading, X and Y specify boundaries, so we need one more boundary
5181+ # than color in each direction. For convenience, and consistent with
5182+ # Matlab, we discard the last row and/or column of C if necessary to
5183+ # meet this condition. This is done if allmatch is False.
51905184
51915185 if len (args ) == 1 :
51925186 C = np .asanyarray (args [0 ])
@@ -5233,7 +5227,7 @@ def _pcolorargs(funcname, *args, **kw):
52335227 'Incompatible X, Y inputs to %s; see help(%s)' % (
52345228 funcname , funcname ))
52355229 if allmatch :
5236- if not (Nx == numCols and Ny == numRows ):
5230+ if (Nx , Ny ) != ( numCols , numRows ):
52375231 raise TypeError ('Dimensions of C %s are incompatible with'
52385232 ' X (%d) and/or Y (%d); see help(%s)' % (
52395233 C .shape , Nx , Ny , funcname ))
0 commit comments