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

Skip to content

Commit 370bdb4

Browse files
committed
replaced super.
vim regexp : %s;Axes..*(self, *;super(Axes3D, self).;g followed by %s;Axes.\(.*\)(self *;super(Axes3D, self).\1(;g and some typo fixes removed extra line
1 parent d1947ce commit 370bdb4

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ def __init__(self, fig, rect=None, *args, **kwargs):
9595
self._shared_z_axes.join(self, sharez)
9696
self._adjustable = 'datalim'
9797

98-
Axes.__init__(self, fig, rect,
99-
frameon=True,
100-
*args, **kwargs)
98+
super(Axes3D, self).__init__(fig, rect,
99+
frameon=True,
100+
*args, **kwargs)
101101
# Disable drawing of axes by base class
102-
Axes.set_axis_off(self)
102+
super(Axes3D, self).set_axis_off()
103103
# Enable drawing of axes by Axes3D class
104104
self.set_axis_on()
105105
self.M = None
@@ -159,7 +159,8 @@ def _process_unit_info(self, xdata=None, ydata=None, zdata=None,
159159
Look for unit *kwargs* and update the axis instances as necessary
160160
161161
"""
162-
Axes._process_unit_info(self, xdata=xdata, ydata=ydata, kwargs=kwargs)
162+
super(Axes3D, self)._process_unit_info(xdata=xdata, ydata=ydata,
163+
kwargs=kwargs)
163164

164165
if self.xaxis is None or self.yaxis is None or self.zaxis is None:
165166
return
@@ -189,8 +190,8 @@ def set_top_view(self):
189190

190191
# This is purposely using the 2D Axes's set_xlim and set_ylim,
191192
# because we are trying to place our viewing pane.
192-
Axes.set_xlim(self, -xdwl, xdw, auto=None)
193-
Axes.set_ylim(self, -ydwl, ydw, auto=None)
193+
super(Axes3D, self).set_xlim(-xdwl, xdw, auto=None)
194+
super(Axes3D, self).set_ylim(-ydwl, ydw, auto=None)
194195

195196
def _init_axis(self):
196197
'''Init 3D axes; overrides creation of regular X/Y axes'''
@@ -208,7 +209,7 @@ def _init_axis(self):
208209
ax.init3d()
209210

210211
def get_children(self):
211-
return [self.zaxis, ] + Axes.get_children(self)
212+
return [self.zaxis, ] + super(Axes3D, self).get_children()
212213

213214
def _get_axis_list(self):
214215
return super(Axes3D, self)._get_axis_list() + (self.zaxis, )
@@ -293,7 +294,7 @@ def draw(self, renderer):
293294
ax.draw(renderer)
294295

295296
# Then rest
296-
Axes.draw(self, renderer)
297+
super(Axes3D, self).draw(renderer)
297298

298299
def get_axis_position(self):
299300
vals = self.get_w_lims()
@@ -313,7 +314,7 @@ def get_autoscale_on(self):
313314
.. versionadded :: 1.1.0
314315
This function was added, but not tested. Please report any bugs.
315316
"""
316-
return Axes.get_autoscale_on(self) and self.get_autoscalez_on()
317+
return super(Axes3D, self).get_autoscale_on() and self.get_autoscalez_on()
317318

318319
def get_autoscalez_on(self):
319320
"""
@@ -333,7 +334,7 @@ def set_autoscale_on(self, b):
333334
.. versionadded :: 1.1.0
334335
This function was added, but not tested. Please report any bugs.
335336
"""
336-
Axes.set_autoscale_on(self, b)
337+
super(Axes3D, self).set_autoscale_on(b)
337338
self.set_autoscalez_on(b)
338339

339340
def set_autoscalez_on(self, b):
@@ -1076,7 +1077,7 @@ def cla(self):
10761077
# Disabling mouse interaction might have been needed a long
10771078
# time ago, but I can't find a reason for it now - BVR (2012-03)
10781079
#self.disable_mouse_rotation()
1079-
Axes.cla(self)
1080+
super(Axes3D, self).cla()
10801081
self.zaxis.cla()
10811082

10821083
if self._sharez is not None:
@@ -1095,7 +1096,6 @@ def cla(self):
10951096
self._autoscaleZon = True
10961097
self._zmargin = 0
10971098

1098-
10991099
self.grid(rcParams['axes3d.grid'])
11001100

11011101
def disable_mouse_rotation(self):
@@ -1415,7 +1415,7 @@ def tick_params(self, axis='both', **kwargs):
14151415
.. versionadded :: 1.1.0
14161416
This function was added, but not tested. Please report any bugs.
14171417
"""
1418-
Axes.tick_params(self, axis, **kwargs)
1418+
super(Axes3D, self).tick_params(axis, **kwargs)
14191419
if axis in ['z', 'both'] :
14201420
zkw = dict(kwargs)
14211421
zkw.pop('top', None)
@@ -1495,7 +1495,7 @@ def text(self, x, y, z, s, zdir=None, **kwargs):
14951495
except for the `zdir` keyword, which sets the direction to be
14961496
used as the z direction.
14971497
'''
1498-
text = Axes.text(self, x, y, s, **kwargs)
1498+
text = super(Axes3D, self).text(x, y, s, **kwargs)
14991499
art3d.text_2d_to_3d(text, z, zdir)
15001500
return text
15011501

@@ -1538,7 +1538,7 @@ def plot(self, xs, ys, *args, **kwargs):
15381538
if not cbook.iterable(zs):
15391539
zs = np.ones(len(xs)) * zs
15401540

1541-
lines = Axes.plot(self, xs, ys, *args, **kwargs)
1541+
lines = super(Axes3D, self).plot(xs, ys, *args, **kwargs)
15421542
for line in lines:
15431543
art3d.line_2d_to_3d(line, zs=zs, zdir=zdir)
15441544

@@ -2107,7 +2107,7 @@ def contour(self, X, Y, Z, *args, **kwargs):
21072107
had_data = self.has_data()
21082108

21092109
jX, jY, jZ = art3d.rotate_axes(X, Y, Z, zdir)
2110-
cset = Axes.contour(self, jX, jY, jZ, *args, **kwargs)
2110+
cset = super(Axes3D, self).contour(jX, jY, jZ, *args, **kwargs)
21112111
self.add_contour_set(cset, extend3d, stride, zdir, offset)
21122112

21132113
self.auto_scale_xyz(X, Y, Z, had_data)
@@ -2164,7 +2164,7 @@ def tricontour(self, *args, **kwargs):
21642164
jX, jY, jZ = art3d.rotate_axes(X, Y, Z, zdir)
21652165
tri = Triangulation(jX, jY, tri.triangles, tri.mask)
21662166

2167-
cset = Axes.tricontour(self, tri, jZ, *args, **kwargs)
2167+
cset = super(Axes3D, self).tricontour(tri, jZ, *args, **kwargs)
21682168
self.add_contour_set(cset, extend3d, stride, zdir, offset)
21692169

21702170
self.auto_scale_xyz(X, Y, Z, had_data)
@@ -2199,7 +2199,7 @@ def contourf(self, X, Y, Z, *args, **kwargs):
21992199
had_data = self.has_data()
22002200

22012201
jX, jY, jZ = art3d.rotate_axes(X, Y, Z, zdir)
2202-
cset = Axes.contourf(self, jX, jY, jZ, *args, **kwargs)
2202+
cset = super(Axes3D, self).contourf(jX, jY, jZ, *args, **kwargs)
22032203
self.add_contourf_set(cset, zdir, offset)
22042204

22052205
self.auto_scale_xyz(X, Y, Z, had_data)
@@ -2251,7 +2251,7 @@ def tricontourf(self, *args, **kwargs):
22512251
jX, jY, jZ = art3d.rotate_axes(X, Y, Z, zdir)
22522252
tri = Triangulation(jX, jY, tri.triangles, tri.mask)
22532253

2254-
cset = Axes.tricontourf(self, tri, jZ, *args, **kwargs)
2254+
cset = super(Axes3D, self).tricontourf(tri, jZ, *args, **kwargs)
22552255
self.add_contourf_set(cset, zdir, offset)
22562256

22572257
self.auto_scale_xyz(X, Y, Z, had_data)
@@ -2288,7 +2288,7 @@ def add_collection3d(self, col, zs=0, zdir='z'):
22882288
art3d.patch_collection_2d_to_3d(col, zs=zs, zdir=zdir)
22892289
col.set_sort_zpos(zsortval)
22902290

2291-
Axes.add_collection(self, col)
2291+
super(Axes3D, self).add_collection(col)
22922292

22932293
def scatter(self, xs, ys, zs=0, zdir='z', s=20, c=None, depthshade=True,
22942294
*args, **kwargs):
@@ -2347,7 +2347,8 @@ def scatter(self, xs, ys, zs=0, zdir='z', s=20, c=None, depthshade=True,
23472347

23482348
xs, ys, zs, s, c = cbook.delete_masked_points(xs, ys, zs, s, c)
23492349

2350-
patches = Axes.scatter(self, xs, ys, s=s, c=c, *args, **kwargs)
2350+
patches = super(Axes3D, self).scatter(xs, ys, s=s, c=c, *args,
2351+
**kwargs)
23512352
if not cbook.iterable(zs):
23522353
is_2d = True
23532354
zs = np.ones(len(xs)) * zs
@@ -2389,7 +2390,7 @@ def bar(self, left, height, zs=0, zdir='z', *args, **kwargs):
23892390

23902391
had_data = self.has_data()
23912392

2392-
patches = Axes.bar(self, left, height, *args, **kwargs)
2393+
patches = super(Axes3D, self).bar(left, height, *args, **kwargs)
23932394

23942395
if not cbook.iterable(zs):
23952396
zs = np.ones(len(left)) * zs
@@ -2564,7 +2565,8 @@ def bar3d(self, x, y, z, dx, dy, dz, color=None,
25642565
return col
25652566

25662567
def set_title(self, label, fontdict=None, loc='center', **kwargs):
2567-
ret = Axes.set_title(self, label, fontdict=fontdict, loc=loc, **kwargs)
2568+
ret = super(Axes3D, self).set_title(label, fontdict=fontdict, loc=loc,
2569+
**kwargs)
25682570
(x, y) = self.title.get_position()
25692571
self.title.set_y(0.92 * y)
25702572
return ret

0 commit comments

Comments
 (0)