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

Skip to content

Commit f928ba9

Browse files
Don't use deprecated function
1 parent 67f4fca commit f928ba9

File tree

3 files changed

+2
-36
lines changed

3 files changed

+2
-36
lines changed

lib/mpl_toolkits/mplot3d/axis3d.py

Lines changed: 2 additions & 3 deletions
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

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,39 +1140,6 @@ def test_world():
11401140
[0, 0, 0, 1]])
11411141

11421142

1143-
@mpl3d_image_comparison(['proj3d_lines_dists.png'], style='mpl20')
1144-
def test_lines_dists():
1145-
fig, ax = plt.subplots(figsize=(4, 6), subplot_kw=dict(aspect='equal'))
1146-
1147-
xs = (0, 30)
1148-
ys = (20, 150)
1149-
ax.plot(xs, ys)
1150-
p0, p1 = zip(xs, ys)
1151-
1152-
xs = (0, 0, 20, 30)
1153-
ys = (100, 150, 30, 200)
1154-
ax.scatter(xs, ys)
1155-
1156-
dist0 = proj3d._line2d_seg_dist((xs[0], ys[0]), p0, p1)
1157-
dist = proj3d._line2d_seg_dist(np.array((xs, ys)).T, p0, p1)
1158-
assert dist0 == dist[0]
1159-
1160-
for x, y, d in zip(xs, ys, dist):
1161-
c = Circle((x, y), d, fill=0)
1162-
ax.add_patch(c)
1163-
1164-
ax.set_xlim(-50, 150)
1165-
ax.set_ylim(0, 300)
1166-
1167-
1168-
def test_lines_dists_nowarning():
1169-
# No RuntimeWarning must be emitted for degenerate segments, see GH#22624.
1170-
s0 = (10, 30, 50)
1171-
p = (20, 150, 180)
1172-
proj3d._line2d_seg_dist(p, s0, s0)
1173-
proj3d._line2d_seg_dist(np.array(p), s0, s0)
1174-
1175-
11761143
def test_autoscale():
11771144
fig, ax = plt.subplots(subplot_kw={"projection": "3d"})
11781145
assert ax.get_zscale() == 'linear'

0 commit comments

Comments
 (0)