@@ -4385,7 +4385,9 @@ def fill(self, *args, **kwargs):
43854385 #### plotting z(x,y): imshow, pcolor and relatives, contour
43864386
43874387
4388- def imshow (self , X ,
4388+ def imshow (self , I ,
4389+ X = None ,
4390+ Y = None ,
43894391 cmap = None ,
43904392 norm = None ,
43914393 aspect = None ,
@@ -4402,18 +4404,24 @@ def imshow(self, X,
44024404 ** kwargs ):
44034405 """
44044406
4405- IMSHOW(X, cmap=None, norm=None, aspect=None, interpolation=None,
4406- alpha=1.0, vmin=None, vmax=None, origin=None, extent=None)
4407+ IMSHOW(I, X=None, Y=None, cmap=None, norm=None, aspect=None,
4408+ interpolation=None, alpha=1.0, vmin=None, vmax=None,
4409+ origin=None, extent=None)
44074410
4408- IMSHOW(X ) - plot image X to current axes, resampling to scale to axes
4409- size (X may be numarray/Numeric array or PIL image)
4411+ IMSHOW(I ) - plot image I to current axes, resampling to scale to axes
4412+ size (I may be numarray/Numeric array or PIL image)
44104413
4411- IMSHOW(X, **kwargs) - Use keyword args to control image scaling,
4412- colormapping etc. See below for details
4414+ IMSHOW(I, X, Y) - plot image I to current axes, with
4415+ nonuniform X and Y axes. (I, X and Y may be
4416+ numarray/Numeric array or PIL image)
4417+
4418+ IMSHOW(I, X, Y, **kwargs) - Use keyword args to control image
4419+ scaling, colormapping etc. See
4420+ below for details
44134421
44144422
4415- Display the image in X to current axes. X may be a float array, a
4416- uint8 array or a PIL image. If X is an array, X can have the following
4423+ Display the image in I to current axes. I may be a float array, a
4424+ uint8 array or a PIL image. If I is an array, I can have the following
44174425 shapes:
44184426
44194427 MxN : luminance (grayscale, float array only)
@@ -4425,6 +4433,10 @@ def imshow(self, X,
44254433 The value for each component of MxNx3 and MxNx4 float arrays should be
44264434 in the range 0.0 to 1.0; MxN float arrays may be normalised.
44274435
4436+ X and/or Y may be provided to specify a non-uniform image
4437+ grid. Each element of the X or Y arrays is the width or height
4438+ of the corresponding pixel in the given image.
4439+
44284440 A image.AxesImage instance is returned
44294441
44304442 The following kwargs are allowed:
@@ -4488,12 +4500,25 @@ def imshow(self, X,
44884500 if norm is not None : assert (isinstance (norm , mcolors .Normalize ))
44894501 if cmap is not None : assert (isinstance (cmap , mcolors .Colormap ))
44904502 if aspect is None : aspect = rcParams ['image.aspect' ]
4491- self .set_aspect (aspect )
4492- im = mimage .AxesImage (self , cmap , norm , interpolation , origin , extent ,
4493- filternorm = filternorm ,
4494- filterrad = filterrad , ** kwargs )
4495-
4496- im .set_data (X )
4503+ # self.set_aspect(aspect)
4504+
4505+ if X is None and Y is None :
4506+ im = mimage .AxesImage (self , cmap , norm , interpolation , origin , extent ,
4507+ filternorm = filternorm ,
4508+ filterrad = filterrad , ** kwargs )
4509+
4510+ im .set_data (I )
4511+ else :
4512+ if X is None :
4513+ X = npy .arange (I .shape [1 ])
4514+ if Y is None :
4515+ Y = npy .arange (I .shape [0 ])
4516+ im = mimage .NonUniformImage (self , cmap = cmap , norm = norm ,
4517+ interpolation = interpolation ,
4518+ origin = origin , extent = extent ,
4519+ filternorm = filternorm ,
4520+ filterrad = filterrad , ** kwargs )
4521+ im .set_data (X , Y , I )
44974522 im .set_alpha (alpha )
44984523 self ._set_artist_props (im )
44994524 im .set_clip_path (self .axesPatch )
@@ -4515,7 +4540,7 @@ def imshow(self, X,
45154540
45164541 return im
45174542
4518-
4543+
45194544 def _pcolorargs (self , funcname , * args ):
45204545 if len (args )== 1 :
45214546 C = args [0 ]
0 commit comments