8000 Merge pull request #26815 from timhoffm/remove-plt-axes · matplotlib/matplotlib@5469134 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5469134

Browse files
authored
Merge pull request #26815 from timhoffm/remove-plt-axes
Remove plt.Axes from tests
2 parents e861ea2 + 6c3ca1c commit 5469134

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

lib/matplotlib/tests/test_bbox_tight.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,7 @@ def test_noop_tight_bbox():
141141
dpi = 100
142142
# make the figure just the right size up front
143143
fig = plt.figure(frameon=False, dpi=dpi, figsize=(x_size/dpi, y_size/dpi))
144-
ax = plt.Axes(fig, [0., 0., 1., 1.])
145-
fig.add_axes(ax)
144+
ax = fig.add_axes((0, 0, 1, 1))
146145
ax.set_axis_off()
147146
ax.xaxis.set_visible(False)
148147
ax.yaxis.set_visible(False)

lib/matplotlib/tests/test_image.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -800,10 +800,8 @@ def test_image_preserve_size2():
800800
data = np.identity(n, float)
801801

802802
fig = plt.figure(figsize=(n, n), frameon=False)
803-
804-
ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
803+
ax = fig.add_axes((0.0, 0.0, 1.0, 1.0))
805804
ax.set_axis_off()
806-
fig.add_axes(ax)
807805
ax.imshow(data, interpolation='nearest', origin='lower', aspect='auto')
808806
buff = io.BytesIO()
809807
fig.savefig(buff, dpi=1)

0 commit comments

Comments
 (0)
0