8000 TST: test get_tightbbox for axes_grid1 · matplotlib/matplotlib@ed621ad · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ed621ad

Browse files
committed
TST: test get_tightbbox for axes_grid1
1 parent b9f79b5 commit ed621ad

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/mpl_toolkits/tests/test_axes_grid1.py

Lines changed: 15 additions & 0 deletions
Origin 8000 al file line numberDiff line numberDiff line change
@@ -406,3 +406,18 @@ def test_image_grid():
406406
for i in range(4):
407407
grid[i].imshow(im)
408408
grid[i].set_title('test {0}{0}'.format(i))
409+
410+
411+
def test_gettightbbox():
412+
413+
fig, ax = plt.subplots(figsize=(8, 6))
414+
415+
l, = ax.plot([1, 2, 3], [0, 1, 0])
416+
417+
ax_zoom = zoomed_inset_axes(ax, 4)
418+
ax_zoom.plot([1, 2, 3], [0, 1, 0])
419+
420+
mark_inset(ax, ax_zoom, loc1=1, loc2=3, fc="none", ec='0.3')
421+
bbox = fig.get_tightbbox(fig.canvas.get_renderer())
422+
np.testing.assert_array_almost_equal(bbox.extents,
423+
[-18.022743, -14.118056, 7.332813, 5.4625])

0 commit comments

Comments
 (0)
0