Skip to content

Commit 9701a39

Browse files
Don't use deprecated function
1 parent f820c40 commit 9701a39

File tree

3 files changed

+2
-36
lines changed

3 files changed

+2
-36
lines changed

lib/mpl_toolkits/mplot3d/axis3d.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,7 @@ def active_pane(self, renderer):
305305
else:
306306
loc = maxs[index]
307307
plane = self._PLANES[2 * index + 1]
308-
xys = [tc[p] for p in plane]
309-
self.pane.xy = xys
308+
xys = np.array([tc[p] for p in plane])
310309
return xys, loc
311310

312311
def draw_pane(self, renderer):
@@ -319,7 +318,7 @@ def draw_pane(self, renderer):
319318
"""
320319
renderer.open_group('pane3d', gid=self.get_gid())
321320
xys, loc = self.active_pane(renderer)
322-
self.pane.xy = xys
321+
self.pane.xy = xys[:, :2]
323322
self.pane.draw(renderer)
324323
renderer.close_group('pane3d')
325324

Binary file not shown.

lib/mpl_toolkits/mplot3d/tests/test_axes3d.py

-33
Original file line numberDiff line numberDiff line change
@@ -1155,39 +1155,6 @@ def test_world():
11551155
[0, 0, 0, 1]])
11561156

11571157

1158-
@mpl3d_image_comparison(['proj3d_lines_dists.png'], style='mpl20')
1159-
def test_lines_dists():
1160-
fig, ax = plt.subplots(figsize=(4, 6), subplot_kw=dict(aspect='equal'))
1161-
1162-
xs = (0, 30)
1163-
ys = (20, 150)
1164-
ax.plot(xs, ys)
1165-
p0, p1 = zip(xs, ys)
1166-
1167-
xs = (0, 0, 20, 30)
1168-
ys = (100, 150, 30, 200)
1169-
ax.scatter(xs, ys)
1170-
1171-
dist0 = proj3d._line2d_seg_dist((xs[0], ys[0]), p0, p1)
1172-
dist = proj3d._line2d_seg_dist(np.array((xs, ys)).T, p0, p1)
1173-
assert dist0 == dist[0]
1174-
1175-
for x, y, d in zip(xs, ys, dist):
1176-
c = Circle((x, y), d, fill=0)
1177-
ax.add_patch(c)
1178-
1179-
ax.set_xlim(-50, 150)
1180-
ax.set_ylim(0, 300)
1181-
1182-
1183-
def test_lines_dists_nowarning():
1184-
# No RuntimeWarning must be emitted for degenerate segments, see GH#22624.
1185-
s0 = (10, 30, 50)
1186-
p = (20, 150, 180)
1187-
proj3d._line2d_seg_dist(p, s0, s0)
1188-
proj3d._line2d_seg_dist(np.array(p), s0, s0)
1189-
1190-
11911158
def test_autoscale():
11921159
fig, ax = plt.subplots(subplot_kw={"projection": "3d"})
11931160
assert ax.get_zscale() == 'linear'

0 commit comments

Comments
 (0)