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

Function test_nodecorator

lib/matplotlib/tests/test_axes.py:8749–8776  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8747
8748
8749def test_nodecorator():
8750 with rc_context({'_internal.classic_mode': False}):
8751 fig, ax = plt.subplots(dpi=200, figsize=(6, 6))
8752 fig.canvas.draw()
8753 ax.set(xticklabels=[], yticklabels=[])
8754 bbaxis, bbspines, bbax, bbtb = color_boxes(fig, ax)
8755
8756 # test the axis bboxes
8757 for nn, b in enumerate(bbaxis):
8758 assert b is None
8759
8760 target = [
8761 [150.0, 119.999, 930.0, 11.111],
8762 [150.0, 1080.0, 930.0, 0.0],
8763 [150.0, 119.9999, 11.111, 960.0],
8764 [1068.8888, 119.9999, 11.111, 960.0]
8765 ]
8766 for nn, b in enumerate(bbspines):
8767 targetbb = mtransforms.Bbox.from_bounds(*target[nn])
8768 assert_allclose(b.bounds, targetbb.bounds, atol=1e-2)
8769
8770 target = [150.0, 119.99999999999997, 930.0, 960.0]
8771 targetbb = mtransforms.Bbox.from_bounds(*target)
8772 assert_allclose(bbax.bounds, targetbb.bounds, atol=1e-2)
8773
8774 target = [150., 120., 930., 960.]
8775 targetbb = mtransforms.Bbox.from_bounds(*target)
8776 assert_allclose(bbtb.bounds, targetbb.bounds, atol=1e-2)
8777
8778
8779def test_displaced_spine():

Callers

nothing calls this directly

Calls 6

rc_contextFunction · 0.90
color_boxesFunction · 0.85
from_boundsMethod · 0.80
subplotsMethod · 0.45
drawMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…