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

Function test_twin_units

lib/matplotlib/tests/test_axes.py:384–397  ·  view source on GitHub ↗
(twin)

Source from the content-addressed store, hash-verified

382
383@pytest.mark.parametrize('twin', ('x', 'y'))
384def test_twin_units(twin):
385 axis_name = f'{twin}axis'
386 twin_func = f'twin{twin}'
387
388 a = ['0', '1']
389 b = ['a', 'b']
390
391 fig = Figure()
392 ax1 = fig.subplots()
393 ax1.plot(a, b)
394 assert getattr(ax1, axis_name).units is not None
395 ax2 = getattr(ax1, twin_func)()
396 assert getattr(ax2, axis_name).units is not None
397 assert getattr(ax2, axis_name).units is getattr(ax1, axis_name).units
398
399
400@pytest.mark.parametrize('twin', ('x', 'y'))

Callers

nothing calls this directly

Calls 3

FigureClass · 0.90
subplotsMethod · 0.45
plotMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…