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

Function test_wrap

lib/matplotlib/tests/test_text.py:702–714  ·  view source on GitHub ↗
(x, rotation, halign)

Source from the content-addressed store, hash-verified

700 (0.3, 0, 'right'),
701 (0.3, 185, 'left')])
702def test_wrap(x, rotation, halign):
703 fig = plt.figure(figsize=(18, 18))
704 gs = GridSpec(nrows=3, ncols=3, figure=fig)
705 subfig = fig.add_subfigure(gs[1, 1])
706 # we only use the central subfigure, which does not align with any
707 # figure boundary, to ensure only subfigure boundaries are relevant
708 s = 'This is a very long text that should be wrapped multiple times.'
709 text = subfig.text(x, 0.7, s, wrap=True, rotation=rotation, ha=halign)
710 fig.canvas.draw()
711 assert text._get_wrapped_text() == ('This is a very long\n'
712 'text that should be\n'
713 'wrapped multiple\n'
714 'times.')
715
716
717def test_mathwrap():

Callers

nothing calls this directly

Calls 6

GridSpecClass · 0.90
figureMethod · 0.80
add_subfigureMethod · 0.80
_get_wrapped_textMethod · 0.80
textMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…