Commit e0795a5c authored by Viacheslav Ostroukh's avatar Viacheslav Ostroukh 🚲 Committed by Viacheslav Ostroukh
Browse files

stop using deprecated mplot3d parameters

`renderer` argument of mplot3d's `do_3d_projection()` is deprecated in
Matplotlib 3.4. This commit switches from using (also deprecated) `renderer.M`
to `self.axes.M`.

A warning about `renderer` being deprecated is still emitted, but we still
need to keep `renderer=None` statements for reverse compatibility.
parent 88d7fa5c
Pipeline #74975 failed with stages
in 8 minutes and 23 seconds
......@@ -156,7 +156,7 @@ if mpl_available:
def set_linewidths(self, linewidths):
self.linewidths_orig = nparray_if_array(linewidths)
def do_3d_projection(self, renderer):
def do_3d_projection(self, renderer=None):
super().do_3d_projection(renderer)
# The whole 3D ordering is flawed in mplot3d when several
# collections are added. We just use normal zorder. Note the
......@@ -247,7 +247,7 @@ if mpl_available:
else:
return Affine2D().scale(self.figure.dpi / 72.0)
def do_3d_projection(self, renderer):
def do_3d_projection(self, renderer=None):
xs, ys, zs = self._offsets3d
# numpy complains about zero-length index arrays
......@@ -255,7 +255,7 @@ if mpl_available:
return -self.zorder3d
proj = mplot3d.proj3d.proj_transform_clip
vs = np.array(proj(xs, ys, zs, renderer.M)[:3])
vs = np.array(proj(xs, ys, zs, self.axes.M)[:3])
if sort3d:
indx = vs[2].argsort()[::-1]
......@@ -311,7 +311,7 @@ if mpl_available:
bbox = np.asarray(self.axes.get_w_lims())
proj = mplot3d.proj3d.proj_transform_clip
cz = proj(*(list(np.dot(corners, bbox)) + [renderer.M]))[2]
cz = proj(*(list(np.dot(corners, bbox)) + [self.axes.M]))[2]
return -self.zorder3d + vs[2].mean() / cz.ptp()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment