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

Skip to content

Commit dfdc014

Browse files
Code review cleanup
1 parent 4fb2d19 commit dfdc014

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

lib/mpl_toolkits/mplot3d/tests/test_axes3d.py

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,7 @@ def test_bar3d_lightsource():
219219

220220
@mpl3d_image_comparison(['contour3d.png'], style='mpl20')
221221
def test_contour3d():
222-
# Remove when regenerating the image
223-
plt.rcParams['axes3d.automargin'] = True
222+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
224223
fig = plt.figure()
225224
ax = fig.add_subplot(projection='3d')
226225
X, Y, Z = axes3d.get_test_data(0.05)
@@ -232,7 +231,7 @@ def test_contour3d():
232231

233232
@mpl3d_image_comparison(['contour3d_extend3d.png'], style='mpl20')
234233
def test_contour3d_extend3d():
235-
plt.rcParams['axes3d.automargin'] = True
234+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
236235
fig = plt.figure()
237236
ax = fig.add_subplot(projection='3d')
238237
X, Y, Z = axes3d.get_test_data(0.05)
@@ -244,7 +243,7 @@ def test_contour3d_extend3d():
244243

245244
@mpl3d_image_comparison(['contourf3d.png'], style='mpl20')
246245
def test_contourf3d():
247-
plt.rcParams['axes3d.automargin'] = True
246+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
248247
fig = plt.figure()
249248
ax = fig.add_subplot(projection='3d')
250249
X, Y, Z = axes3d.get_test_data(0.05)
@@ -258,7 +257,7 @@ def test_contourf3d():
258257

259258
@mpl3d_image_comparison(['contourf3d_fill.png'], style='mpl20')
260259
def test_contourf3d_fill():
261-
plt.rcParams['axes3d.automargin'] = True
260+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
262261
fig = plt.figure()
263262
ax = fig.add_subplot(projection='3d')
264263
X, Y = np.meshgrid(np.arange(-2, 2, 0.25), np.arange(-2, 2, 0.25))
@@ -302,7 +301,7 @@ def test_contourf3d_extend(fig_test, fig_ref, extend, levels):
302301

303302
@mpl3d_image_comparison(['tricontour.png'], tol=0.02, style='mpl20')
304303
def test_tricontour():
305-
plt.rcParams['axes3d.automargin'] = True
304+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
306305
fig = plt.figure()
307306

308307
np.random.seed(19680801)
@@ -372,7 +371,7 @@ def f(t):
372371
t1 = np.arange(0.0, 5.0, 0.1)
373372
t2 = np.arange(0.0, 5.0, 0.02)
374373

375-
plt.rcParams['axes3d.automargin'] = True
374+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
376375
fig = plt.figure(figsize=plt.figaspect(2.))
377376
ax = fig.add_subplot(2, 1, 1)
378377
ax.plot(t1, f(t1), 'bo', t2, f(t2), 'k--', markerfacecolor='green')
@@ -404,7 +403,7 @@ def test_tight_layout_text(fig_test, fig_ref):
404403

405404
@mpl3d_image_comparison(['scatter3d.png'], style='mpl20')
406405
def test_scatter3d():
407-
plt.rcParams['axes3d.automargin'] = True
406+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
408407
fig = plt.figure()
409408
ax = fig.add_subplot(projection='3d')
410409
ax.scatter(np.arange(10), np.arange(10), np.arange(10),
@@ -418,7 +417,7 @@ def test_scatter3d():
418417

419418
@mpl3d_image_comparison(['scatter3d_color.png'], style='mpl20')
420419
def test_scatter3d_color():
421-
plt.rcParams['axes3d.automargin'] = True
420+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
422421
fig = plt.figure()
423422
ax = fig.add_subplot(projection='3d')
424423

@@ -603,14 +602,14 @@ def test_surface3d():
603602
Z = np.sin(R)
604603
surf = ax.plot_surface(X, Y, Z, rcount=40, ccount=40, cmap=cm.coolwarm,
605604
lw=0, antialiased=False)
606-
plt.rcParams['axes3d.automargin'] = True
605+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
607606
ax.set_zlim(-1.01, 1.01)
608607
fig.colorbar(surf, shrink=0.5, aspect=5)
609608

610609

611610
@image_comparison(['surface3d_label_offset_tick_position.png'], style='mpl20')
612611
def test_surface3d_label_offset_tick_position():
613-
plt.rcParams['axes3d.automargin'] = True
612+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
614613
ax = plt.figure().add_subplot(projection="3d")
615614

616615
x, y = np.mgrid[0:6 * np.pi:0.25, 0:4 * np.pi:0.25]
@@ -635,7 +634,7 @@ def test_surface3d_shaded():
635634
Z = np.sin(R)
636635
ax.plot_surface(X, Y, Z, rstride=5, cstride=5,
637636
color=[0.25, 1, 0.25], lw=1, antialiased=False)
638-
plt.rcParams['axes3d.automargin'] = True
637+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
639638
ax.set_zlim(-1.01, 1.01)
640639

641640

@@ -704,7 +703,7 @@ def test_text3d():
704703

705704
ax.text(1, 1, 1, "red", color='red')
706705
ax.text2D(0.05, 0.95, "2D Text", transform=ax.transAxes)
707-
plt.rcParams['axes3d.automargin'] = True
706+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
708707
ax.set_xlim3d(0, 10)
709708
ax.set_ylim3d(0, 10)
710709
ax.set_zlim3d(0, 10)
@@ -818,7 +817,7 @@ def test_mixedsamplesraises():
818817

819818
@mpl3d_image_comparison(['quiver3d.png'], style='mpl20')
820819
def test_quiver3d():
821-
plt.rcParams['axes3d.automargin'] = True
820+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
822821
fig = plt.figure()
823822
ax = fig.add_subplot(projection='3d')
824823
pivots = ['tip', 'middle', 'tail']
@@ -987,7 +986,7 @@ def test_add_collection3d_zs_array():
987986

988987
assert line is not None
989988

990-
plt.rcParams['axes3d.automargin'] = True
989+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
991990
ax.set_xlim(-5, 5)
992991
ax.set_ylim(-4, 6)
993992
ax.set_zlim(-2, 2)
@@ -1014,7 +1013,7 @@ def test_add_collection3d_zs_scalar():
10141013

10151014
assert line is not None
10161015

1017-
plt.rcParams['axes3d.automargin'] = True
1016+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
10181017
ax.set_xlim(-5, 5)
10191018
ax.set_ylim(-4, 6)
10201019
ax.set_zlim(0, 2)
@@ -1136,7 +1135,7 @@ def test_proj_axes_cube():
11361135
for x, y, t in zip(txs, tys, ts):
11371136
ax.text(x, y, t)
11381137

1139-
plt.rcParams['axes3d.automargin'] = True
1138+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
11401139
ax.set_xlim(-0.2, 0.2)
11411140
ax.set_ylim(-0.2, 0.2)
11421141

@@ -1166,7 +1165,7 @@ def test_proj_axes_cube_ortho():
11661165
for x, y, t in zip(txs, tys, ts):
11671166
ax.text(x, y, t)
11681167

1169-
plt.rcParams['axes3d.automargin'] = True
1168+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
11701169
ax.set_xlim(-200, 200)
11711170
ax.set_ylim(-200, 200)
11721171

@@ -1571,7 +1570,7 @@ def test_errorbar3d():
15711570

15721571
@image_comparison(['stem3d.png'], style='mpl20', tol=0.003)
15731572
def test_stem3d():
1574-
plt.rcParams['axes3d.automargin'] = True
1573+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
15751574
fig, axs = plt.subplots(2, 3, figsize=(8, 6),
15761575
constrained_layout=True,
15771576
subplot_kw={'projection': '3d'})
@@ -1877,7 +1876,7 @@ def test_subfigure_simple():
18771876
@image_comparison(baseline_images=['computed_zorder'], remove_text=True,
18781877
extensions=['png'], style=('mpl20'))
18791878
def test_computed_zorder():
1880-
plt.rcParams['axes3d.automargin'] = True
1879+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
18811880
fig = plt.figure()
18821881
ax1 = fig.add_subplot(221, projection='3d')
18831882
ax2 = fig.add_subplot(222, projection='3d')
@@ -2073,7 +2072,7 @@ def test_pathpatch_3d(fig_test, fig_ref):
20732072
remove_text=True,
20742073
style='mpl20')
20752074
def test_scatter_spiral():
2076-
plt.rcParams['axes3d.automargin'] = True
2075+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
20772076
fig = plt.figure()
20782077
ax = fig.add_subplot(projection='3d')
20792078
th = np.linspace(0, 2 * np.pi * 6, 256)

0 commit comments

Comments
 (0)