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

Function test_log_margins

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

Source from the content-addressed store, hash-verified

8091
8092
8093def test_log_margins():
8094 plt.rcParams['axes.autolimit_mode'] = 'data'
8095 fig, ax = plt.subplots()
8096 margin = 0.05
8097 ax.set_xmargin(margin)
8098 ax.semilogx([10, 100], [10, 100])
8099 xlim0, xlim1 = ax.get_xlim()
8100 transform = ax.xaxis.get_transform()
8101 xlim0t, xlim1t = transform.transform([xlim0, xlim1])
8102 x0t, x1t = transform.transform([10, 100])
8103 delta = (x1t - x0t) * margin
8104 assert_allclose([xlim0t + delta, xlim1t - delta], [x0t, x1t])
8105
8106
8107def test_color_length_mismatch():

Callers

nothing calls this directly

Calls 6

set_xmarginMethod · 0.80
semilogxMethod · 0.80
subplotsMethod · 0.45
get_xlimMethod · 0.45
get_transformMethod · 0.45
transformMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…