Skip to content

Commit 6b38c5e

Browse files
Code review cleanup
1 parent 43ed94f commit 6b38c5e

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
@@ -207,8 +207,7 @@ def test_bar3d_lightsource():
207207

208208
@mpl3d_image_comparison(['contour3d.png'], style='mpl20')
209209
def test_contour3d():
210-
# Remove when regenerating the image
211-
plt.rcParams['axes3d.automargin'] = True
210+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
212211
fig = plt.figure()
213212
ax = fig.add_subplot(projection='3d')
214213
X, Y, Z = axes3d.get_test_data(0.05)
@@ -222,7 +221,7 @@ def test_contour3d():
222221

223222
@mpl3d_image_comparison(['contour3d_extend3d.png'], style='mpl20')
224223
def test_contour3d_extend3d():
225-
plt.rcParams['axes3d.automargin'] = True
224+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
226225
fig = plt.figure()
227226
ax = fig.add_subplot(projection='3d')
228227
X, Y, Z = axes3d.get_test_data(0.05)
@@ -234,7 +233,7 @@ def test_contour3d_extend3d():
234233

235234
@mpl3d_image_comparison(['contourf3d.png'], style='mpl20')
236235
def test_contourf3d():
237-
plt.rcParams['axes3d.automargin'] = True
236+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
238237
fig = plt.figure()
239238
ax = fig.add_subplot(projection='3d')
240239
X, Y, Z = axes3d.get_test_data(0.05)
@@ -248,7 +247,7 @@ def test_contourf3d():
248247

249248
@mpl3d_image_comparison(['contourf3d_fill.png'], style='mpl20')
250249
def test_contourf3d_fill():
251-
plt.rcParams['axes3d.automargin'] = True
250+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
252251
fig = plt.figure()
253252
ax = fig.add_subplot(projection='3d')
254253
X, Y = np.meshgrid(np.arange(-2, 2, 0.25), np.arange(-2, 2, 0.25))
@@ -292,7 +291,7 @@ def test_contourf3d_extend(fig_test, fig_ref, extend, levels):
292291

293292
@mpl3d_image_comparison(['tricontour.png'], tol=0.02, style='mpl20')
294293
def test_tricontour():
295-
plt.rcParams['axes3d.automargin'] = True
294+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
296295
fig = plt.figure()
297296

298297
np.random.seed(19680801)
@@ -362,7 +361,7 @@ def f(t):
362361
t1 = np.arange(0.0, 5.0, 0.1)
363362
t2 = np.arange(0.0, 5.0, 0.02)
364363

365-
plt.rcParams['axes3d.automargin'] = True
364+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
366365
fig = plt.figure(figsize=plt.figaspect(2.))
367366
ax = fig.add_subplot(2, 1, 1)
368367
ax.plot(t1, f(t1), 'bo', t2, f(t2), 'k--', markerfacecolor='green')
@@ -394,7 +393,7 @@ def test_tight_layout_text(fig_test, fig_ref):
394393

395394
@mpl3d_image_comparison(['scatter3d.png'], style='mpl20')
396395
def test_scatter3d():
397-
plt.rcParams['axes3d.automargin'] = True
396+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
398397
fig = plt.figure()
399398
ax = fig.add_subplot(projection='3d')
400399
ax.scatter(np.arange(10), np.arange(10), np.arange(10),
@@ -408,7 +407,7 @@ def test_scatter3d():
408407

409408
@mpl3d_image_comparison(['scatter3d_color.png'], style='mpl20')
410409
def test_scatter3d_color():
411-
plt.rcParams['axes3d.automargin'] = True
410+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
412411
fig = plt.figure()
413412
ax = fig.add_subplot(projection='3d')
414413

@@ -593,14 +592,14 @@ def test_surface3d():
593592
Z = np.sin(R)
594593
surf = ax.plot_surface(X, Y, Z, rcount=40, ccount=40, cmap=cm.coolwarm,
595594
lw=0, antialiased=False)
596-
plt.rcParams['axes3d.automargin'] = True
595+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
597596
ax.set_zlim(-1.01, 1.01)
598597
fig.colorbar(surf, shrink=0.5, aspect=5)
599598

600599

601600
@image_comparison(['surface3d_label_offset_tick_position.png'], style='mpl20')
602601
def test_surface3d_label_offset_tick_position():
603-
plt.rcParams['axes3d.automargin'] = True
602+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
604603
ax = plt.figure().add_subplot(projection="3d")
605604

606605
x, y = np.mgrid[0:6 * np.pi:0.25, 0:4 * np.pi:0.25]
@@ -625,7 +624,7 @@ def test_surface3d_shaded():
625624
Z = np.sin(R)
626625
ax.plot_surface(X, Y, Z, rstride=5, cstride=5,
627626
color=[0.25, 1, 0.25], lw=1, antialiased=False)
628-
plt.rcParams['axes3d.automargin'] = True
627+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
629628
ax.set_zlim(-1.01, 1.01)
630629

631630

@@ -694,7 +693,7 @@ def test_text3d():
694693

695694
ax.text(1, 1, 1, "red", color='red')
696695
ax.text2D(0.05, 0.95, "2D Text", transform=ax.transAxes)
697-
plt.rcParams['axes3d.automargin'] = True
696+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
698697
ax.set_xlim3d(0, 10)
699698
ax.set_ylim3d(0, 10)
700699
ax.set_zlim3d(0, 10)
@@ -808,7 +807,7 @@ def test_mixedsamplesraises():
808807

809808
@mpl3d_image_comparison(['quiver3d.png'], style='mpl20')
810809
def test_quiver3d():
811-
plt.rcParams['axes3d.automargin'] = True
810+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
812811
fig = plt.figure()
813812
ax = fig.add_subplot(projection='3d')
814813
pivots = ['tip', 'middle', 'tail']
@@ -977,7 +976,7 @@ def test_add_collection3d_zs_array():
977976

978977
assert line is not None
979978

980-
plt.rcParams['axes3d.automargin'] = True
979+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
981980
ax.set_xlim(-5, 5)
982981
ax.set_ylim(-4, 6)
983982
ax.set_zlim(-2, 2)
@@ -1004,7 +1003,7 @@ def test_add_collection3d_zs_scalar():
10041003

10051004
assert line is not None
10061005

1007-
plt.rcParams['axes3d.automargin'] = True
1006+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
10081007
ax.set_xlim(-5, 5)
10091008
ax.set_ylim(-4, 6)
10101009
ax.set_zlim(0, 2)
@@ -1126,7 +1125,7 @@ def test_proj_axes_cube():
11261125
for x, y, t in zip(txs, tys, ts):
11271126
ax.text(x, y, t)
11281127

1129-
plt.rcParams['axes3d.automargin'] = True
1128+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
11301129
ax.set_xlim(-0.2, 0.2)
11311130
ax.set_ylim(-0.2, 0.2)
11321131

@@ -1156,7 +1155,7 @@ def test_proj_axes_cube_ortho():
11561155
for x, y, t in zip(txs, tys, ts):
11571156
ax.text(x, y, t)
11581157

1159-
plt.rcParams['axes3d.automargin'] = True
1158+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
11601159
ax.set_xlim(-200, 200)
11611160
ax.set_ylim(-200, 200)
11621161

@@ -1561,7 +1560,7 @@ def test_errorbar3d():
15611560

15621561
@image_comparison(['stem3d.png'], style='mpl20', tol=0.003)
15631562
def test_stem3d():
1564-
plt.rcParams['axes3d.automargin'] = True
1563+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
15651564
fig, axs = plt.subplots(2, 3, figsize=(8, 6),
15661565
constrained_layout=True,
15671566
subplot_kw={'projection': '3d'})
@@ -1867,7 +1866,7 @@ def test_subfigure_simple():
18671866
@image_comparison(baseline_images=['computed_zorder'], remove_text=True,
18681867
extensions=['png'], style=('mpl20'))
18691868
def test_computed_zorder():
1870-
plt.rcParams['axes3d.automargin'] = True
1869+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
18711870
fig = plt.figure()
18721871
ax1 = fig.add_subplot(221, projection='3d')
18731872
ax2 = fig.add_subplot(222, projection='3d')
@@ -2063,7 +2062,7 @@ def test_pathpatch_3d(fig_test, fig_ref):
20632062
remove_text=True,
20642063
style='mpl20')
20652064
def test_scatter_spiral():
2066-
plt.rcParams['axes3d.automargin'] = True
2065+
plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
20672066
fig = plt.figure()
20682067
ax = fig.add_subplot(projection='3d')
20692068
th = np.linspace(0, 2 * np.pi * 6, 256)

0 commit comments

Comments
 (0)