MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_get_window_extent_wrapped

Function test_get_window_extent_wrapped

lib/matplotlib/tests/test_text.py:726–739  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

724
725
726def test_get_window_extent_wrapped():
727 # Test that a long title that wraps to two lines has the same vertical
728 # extent as an explicit two line title.
729
730 fig1 = plt.figure(figsize=(3, 3))
731 fig1.suptitle("suptitle that is clearly too long in this case", wrap=True)
732 window_extent_test = fig1._suptitle.get_window_extent()
733
734 fig2 = plt.figure(figsize=(3, 3))
735 fig2.suptitle("suptitle that is clearly\ntoo long in this case")
736 window_extent_ref = fig2._suptitle.get_window_extent()
737
738 assert window_extent_test.y0 == window_extent_ref.y0
739 assert window_extent_test.y1 == window_extent_ref.y1
740
741
742def test_long_word_wrap():

Callers

nothing calls this directly

Calls 3

figureMethod · 0.80
suptitleMethod · 0.80
get_window_extentMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…