Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0b8d693

Browse files
committed
Use super()
1 parent 6d3518a commit 0b8d693

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

lib/matplotlib/image.py

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -608,15 +608,16 @@ def __init__(self, ax,
608608

609609
self._extent = extent
610610

611-
_ImageBase.__init__(self, ax,
612-
cmap=cmap,
613-
norm=norm,
614-
interpolation=interpolation,
615-
origin=origin,
616-
filternorm=filternorm,
617-
filterrad=filterrad,
618-
resample=resample,
619-
**kwargs
611+
super(AxesImage, self).__init__(
612+
ax,
613+
cmap=cmap,
614+
norm=norm,
615+
interpolation=interpolation,
616+
origin=origin,
617+
filternorm=filternorm,
618+
filterrad=filterrad,
619+
resample=resample,
620+
**kwargs
620621
)
621622

622623
def get_window_extent(self, renderer=None):
@@ -705,8 +706,7 @@ def __init__(self, ax, **kwargs):
705706
options.
706707
"""
707708
interp = kwargs.pop('interpolation', 'nearest')
708-
AxesImage.__init__(self, ax,
709-
**kwargs)
709+
super(NonUniformImage, self).__init__(ax, **kwargs)
710710
self.set_interpolation(interp)
711711

712712
def _check_unsampled_image(self, renderer):
@@ -840,13 +840,7 @@ def __init__(self, ax,
840840
Additional kwargs are matplotlib.artist properties
841841
842842
"""
843-
martist.Artist.__init__(self)
844-
cm.ScalarMappable.__init__(self, norm, cmap)
845-
self.axes = ax
846-
self._rgbacache = None
847-
# There is little point in caching the image itself because
848-
# it needs to be remade if the bbox or viewlim change,
849-
# so caching does help with zoom/pan/resize.
843+
super(PcolorImage, self).__init__(ax, norm=norm, cmap=cmap)
850844
self.update(kwargs)
851845
self.set_data(x, y, A)
852846

@@ -937,8 +931,12 @@ def __init__(self, fig,
937931
938932
kwargs are an optional list of Artist keyword args
939933
"""
940-
_ImageBase.__init__(
941-
self, None, norm=norm, cmap=cmap, origin=origin)
934+
super(FigureImage, self).__init__(
935+
None,
936+
norm=norm,
937+
cmap=cmap,
938+
origin=origin
939+
)
942940
self.figure = fig
943941
self.ox = offsetx
944942
self.oy = offsety
@@ -989,15 +987,17 @@ def __init__(self, bbox,
989987
kwargs are an optional list of Artist keyword args
990988
991989
"""
992-
_ImageBase.__init__(self, ax=None,
993-
cmap=cmap,
994-
norm=norm,
995-
interpolation=interpolation,
996-
origin=origin,
997-
filternorm=filternorm,
998-
filterrad=filterrad,
999-
resample=resample,
1000-
**kwargs)
990+
super(BboxImage, self).__init__(
991+
None,
992+
cmap=cmap,
993+
norm=norm,
994+
interpolation=interpolation,
995+
origin=origin,
996+
filternorm=filternorm,
997+
filterrad=filterrad,
998+
resample=resample,
999+
**kwargs
1000+
)
10011001

10021002
self.bbox = bbox
10031003
self.interp_at_native = interp_at_native

0 commit comments

Comments
 (0)