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

Function test_displaced_spine

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

Source from the content-addressed store, hash-verified

8777
8778
8779def test_displaced_spine():
8780 with rc_context({'_internal.classic_mode': False}):
8781 fig, ax = plt.subplots(dpi=200, figsize=(6, 6))
8782 ax.set(xticklabels=[], yticklabels=[])
8783 ax.spines.bottom.set_position(('axes', -0.1))
8784 fig.canvas.draw()
8785 bbaxis, bbspines, bbax, bbtb = color_boxes(fig, ax)
8786
8787 targets = [
8788 [150., 24., 930., 11.111111],
8789 [150.0, 1080.0, 930.0, 0.0],
8790 [150.0, 119.9999, 11.111, 960.0],
8791 [1068.8888, 119.9999, 11.111, 960.0]
8792 ]
8793 for target, bbspine in zip(targets, bbspines):
8794 targetbb = mtransforms.Bbox.from_bounds(*target)
8795 assert_allclose(bbspine.bounds, targetbb.bounds, atol=1e-2)
8796
8797 target = [150.0, 119.99999999999997, 930.0, 960.0]
8798 targetbb = mtransforms.Bbox.from_bounds(*target)
8799 assert_allclose(bbax.bounds, targetbb.bounds, atol=1e-2)
8800
8801 target = [150., 24., 930., 1056.]
8802 targetbb = mtransforms.Bbox.from_bounds(*target)
8803 assert_allclose(bbtb.bounds, targetbb.bounds, atol=1e-2)
8804
8805
8806def test_tickdirs():

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…