MCPcopy
hub / github.com/matplotlib/matplotlib / test_twinx_axis_scales

Function test_twinx_axis_scales

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

Source from the content-addressed store, hash-verified

444@image_comparison(['twin_autoscale.png'], style='_classic_test',
445 tol=0 if platform.machine() == 'x86_64' else 0.009)
446def test_twinx_axis_scales():
447 x = np.array([0, 0.5, 1])
448 y = 0.5 * x
449 x2 = np.array([0, 1, 2])
450 y2 = 2 * x2
451
452 fig = plt.figure()
453 ax = fig.add_axes((0, 0, 1, 1), autoscalex_on=False, autoscaley_on=False)
454 ax.plot(x, y, color='blue', lw=10)
455
456 ax2 = plt.twinx(ax)
457 ax2.plot(x2, y2, 'r--', lw=5)
458
459 ax.margins(0, 0)
460 ax2.margins(0, 0)
461
462
463def test_twin_inherit_autoscale_setting():

Callers

nothing calls this directly

Calls 5

figureMethod · 0.80
add_axesMethod · 0.80
plotMethod · 0.45
twinxMethod · 0.45
marginsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…