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

Skip to content

Commit 49570b4

Browse files
committed
TST: add tightbbox test
1 parent 1930b42 commit 49570b4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5849,3 +5849,10 @@ class DummySubplot(matplotlib.axes.SubplotBase, Dummy):
58495849
FactoryDummySubplot = matplotlib.axes.subplot_class_factory(Dummy)
58505850

58515851
assert DummySubplot is FactoryDummySubplot
5852+
5853+
5854+
def test_gettightbbox_ignoreNaN():
5855+
fig, ax = plt.subplots()
5856+
t = ax.text(np.NaN, 1, 'Boo')
5857+
renderer = fig.canvas.get_renderer()
5858+
np.testing.assert_allclose(ax.get_tightbbox(renderer).width, 532.444444)

0 commit comments

Comments
 (0)