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

Function test_minor_accountedfor

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

Source from the content-addressed store, hash-verified

8826
8827
8828def test_minor_accountedfor():
8829 with rc_context({'_internal.classic_mode': False}):
8830 fig, ax = plt.subplots(dpi=200, figsize=(6, 6))
8831 fig.canvas.draw()
8832 ax.tick_params(which='both', direction='out')
8833
8834 bbaxis, bbspines, bbax, bbtb = color_boxes(fig, ax)
8835 bbaxis, bbspines, bbax, bbtb = color_boxes(fig, ax)
8836 targets = [[150.0, 108.88888888888886, 930.0, 11.111111111111114],
8837 [138.8889, 119.9999, 11.1111, 960.0]]
8838 for n in range(2):
8839 targetbb = mtransforms.Bbox.from_bounds(*targets[n])
8840 assert_allclose(
8841 bbspines[n * 2].bounds, targetbb.bounds, atol=1e-2)
8842
8843 fig, ax = plt.subplots(dpi=200, figsize=(6, 6))
8844 fig.canvas.draw()
8845 ax.tick_params(which='both', direction='out')
8846 ax.minorticks_on()
8847 ax.tick_params(axis='both', which='minor', length=30)
8848 fig.canvas.draw()
8849 bbaxis, bbspines, bbax, bbtb = color_boxes(fig, ax)
8850 targets = [[150.0, 36.66666666666663, 930.0, 83.33333333333334],
8851 [66.6667, 120.0, 83.3333, 960.0]]
8852
8853 for n in range(2):
8854 targetbb = mtransforms.Bbox.from_bounds(*targets[n])
8855 assert_allclose(
8856 bbspines[n * 2].bounds, targetbb.bounds, atol=1e-2)
8857
8858
8859@check_figures_equal()

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…