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

Function test_secondary_resize

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

Source from the content-addressed store, hash-verified

8579
8580
8581def test_secondary_resize():
8582 fig, ax = plt.subplots(figsize=(10, 5))
8583 ax.plot(np.arange(2, 11), np.arange(2, 11))
8584
8585 def invert(x):
8586 with np.errstate(divide='ignore'):
8587 return 1 / x
8588
8589 ax.secondary_xaxis('top', functions=(invert, invert))
8590 fig.canvas.draw()
8591 fig.set_size_inches((7, 4))
8592 assert_allclose(ax.get_position().extents, [0.125, 0.1, 0.9, 0.9])
8593
8594
8595def test_secondary_minorloc():

Callers

nothing calls this directly

Calls 6

secondary_xaxisMethod · 0.80
set_size_inchesMethod · 0.80
subplotsMethod · 0.45
plotMethod · 0.45
drawMethod · 0.45
get_positionMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…