Commit ddecde8c authored by Viacheslav Ostroukh's avatar Viacheslav Ostroukh 🚲
Browse files

Merge branch 'stable-matplotlib-3.4-deprecation-backport' into 'stable'

Backport Matplotlib fixes from master

See merge request !395
parents a9fedcf5 e0795a5c
Pipeline #75436 failed with stages
in 8 minutes and 14 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
......@@ -192,6 +192,10 @@ if mpl_available:
if offsets is not None:
kwargs['offsets'] = offsets[:, :2]
# Workaround for issue in Matplotlib-3.4.2 before PR merged
# https://github.com/matplotlib/matplotlib/pull/20416
self._z_markers_idx = slice(-1)
super().__init__(paths, **kwargs)
if offsets is not None:
......@@ -243,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
......@@ -251,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]
......@@ -307,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