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

Function test_tickdirs

lib/matplotlib/tests/test_axes.py:8806–8825  ·  view source on GitHub ↗

Switch the tickdirs and make sure the bboxes switch with them

()

Source from the content-addressed store, hash-verified

8804
8805
8806def test_tickdirs():
8807 """
8808 Switch the tickdirs and make sure the bboxes switch with them
8809 """
8810 targets = [[[150.0, 120.0, 930.0, 11.1111],
8811 [150.0, 120.0, 11.111, 960.0]],
8812 [[150.0, 108.8889, 930.0, 11.111111111111114],
8813 [138.889, 120, 11.111, 960.0]],
8814 [[150.0, 114.44444444444441, 930.0, 11.111111111111114],
8815 [144.44444444444446, 119.999, 11.111, 960.0]]]
8816 for dnum, dirs in enumerate(['in', 'out', 'inout']):
8817 with rc_context({'_internal.classic_mode': False}):
8818 fig, ax = plt.subplots(dpi=200, figsize=(6, 6))
8819 ax.tick_params(direction=dirs)
8820 fig.canvas.draw()
8821 bbaxis, bbspines, bbax, bbtb = color_boxes(fig, ax)
8822 for nn, num in enumerate([0, 2]):
8823 targetbb = mtransforms.Bbox.from_bounds(*targets[dnum][nn])
8824 assert_allclose(
8825 bbspines[num].bounds, targetbb.bounds, atol=1e-2)
8826
8827
8828def test_minor_accountedfor():

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…