8000 TST: add test for spine positions behaving after a zoom · matplotlib/matplotlib@5545050 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5545050

Browse files
committed
TST: add test for spine positions behaving after a zoom
1 parent bf98993 commit 5545050

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5782,3 +5782,13 @@ def test_zoom_inset():
8FC5
57825782
[0.8425, 0.907692]])
57835783
np.testing.assert_allclose(axin1.get_position().get_points(),
57845784
xx, rtol=1e-4)
5785+
5786+
5787+
def test_spines_properbbox_after_zoom():
5788+
fig, ax = plt.subplots()
5789+
bb = ax.spines['bottom'].get_window_extent(fig.canvas.get_renderer())
5790+
# this is what zoom calls:
5791+
ax._set_view_from_bbox((320, 320, 500, 500), 'in',
5792+
None, False, False)
5793+
bb2 = ax.spines['bottom'].get_window_extent(fig.canvas.get_renderer())
5794+
np.testing.assert_allclose(bb.get_points(), bb2.get_points(), rtol=1e-6)

0 commit comments

Comments
 (0)
0