Skip to content

Commit 07ac112

Browse files
committed
TST: add tightbbox test
1 parent 763bfac commit 07ac112

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/matplotlib/tests/test_artist.py

+8
Original file line numberDiff line numberDiff line change
@@ -277,3 +277,11 @@ def set_f(self, arg):
277277
""" % accept_clause
278278
valid_values = martist.ArtistInspector(TestArtist).get_valid_values('f')
279279
assert valid_values == expected
280+
281+
282+
def test_gettightbbox_ignoreNaN():
283+
fig, ax = plt.subplots()
284+
t = ax.text(np.NaN, 1, 'Boo')
285+
renderer = fig.canvas.get_renderer()
286+
assert t.get_tightbbox(renderer) is None
287+
np.testing.assert_allclose(ax.get_tightbbox(renderer).width, 532.444444)

0 commit comments

Comments
 (0)