Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f3e92c8

Browse files
committed
TST: add test for fig legend and tightbbox
1 parent 1839d93 commit f3e92c8

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed
Binary file not shown.

lib/matplotlib/tests/test_bbox_tight.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
@image_comparison(['bbox_inches_tight'], remove_text=True,
13-
savefig_kwarg=dict(bbox_inches='tight'))
13+
savefig_kwarg={'bbox_inches': 'tight'})
1414
def test_bbox_inches_tight():
1515
#: Test that a figure saved using bbox_inches='tight' is clipped correctly
1616
data = [[66386, 174296, 75131, 577908, 32015],
@@ -35,6 +35,8 @@ def test_bbox_inches_tight():
3535
plt.xticks([])
3636
plt.xlim(0, 5)
3737
plt.legend([''] * 5, loc=(1.2, 0.2))
38+
# check that this doesn't move...
39+
fig.legend([''] * 5, bbox_to_anchor=(0, 0.2), loc='lower left')
3840
# Add a table at the bottom of the axes
3941
cellText.reverse()
4042
plt.table(cellText=cellText, rowLabels=rowLabels, colLabels=colLabels,

0 commit comments

Comments
 (0)