Skip to content

Commit

Permalink
Remove usage of plt.Axes from tests
Browse files Browse the repository at this point in the history
Axes is considered private in pyplot. See also matplotlib#26812.
  • Loading branch information
timhoffm committed Sep 18, 2023
1 parent 538bd83 commit 6c3ca1c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions lib/matplotlib/tests/test_bbox_tight.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ def test_noop_tight_bbox():
dpi = 100
# make the figure just the right size up front
fig = plt.figure(frameon=False, dpi=dpi, figsize=(x_size/dpi, y_size/dpi))
ax = plt.Axes(fig, [0., 0., 1., 1.])
fig.add_axes(ax)
ax = fig.add_axes((0, 0, 1, 1))
ax.set_axis_off()
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)
Expand Down
4 changes: 1 addition & 3 deletions lib/matplotlib/tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,10 +800,8 @@ def test_image_preserve_size2():
data = np.identity(n, float)

fig = plt.figure(figsize=(n, n), frameon=False)

ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
ax = fig.add_axes((0.0, 0.0, 1.0, 1.0))
ax.set_axis_off()
fig.add_axes(ax)
ax.imshow(data, interpolation='nearest', origin='lower', aspect='auto')
buff = io.BytesIO()
fig.savefig(buff, dpi=1)
Expand Down

0 comments on commit 6c3ca1c

Please sign in to comment.