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

Function test_loglog_nonpos

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

Source from the content-addressed store, hash-verified

7522@image_comparison(["test_loglog_nonpos.png"], remove_text=True, style='mpl20',
7523 tol=0.029)
7524def test_loglog_nonpos():
7525 fig, axs = plt.subplots(3, 3)
7526 x = np.arange(1, 11)
7527 y = x**3
7528 y[7] = -3.
7529 x[4] = -10
7530 for (mcy, mcx), ax in zip(product(['mask', 'clip', ''], repeat=2),
7531 axs.flat):
7532 if mcx == mcy:
7533 if mcx:
7534 ax.loglog(x, y**3, lw=2, nonpositive=mcx)
7535 else:
7536 ax.loglog(x, y**3, lw=2)
7537 else:
7538 ax.loglog(x, y**3, lw=2)
7539 if mcx:
7540 ax.set_xscale("log", nonpositive=mcx)
7541 if mcy:
7542 ax.set_yscale("log", nonpositive=mcy)
7543 ax.set_yticks([1e3, 1e7]) # Backcompat tick selection.
7544
7545
7546@mpl.style.context('default')

Callers

nothing calls this directly

Calls 5

loglogMethod · 0.80
set_xscaleMethod · 0.80
set_yticksMethod · 0.80
subplotsMethod · 0.45
set_yscaleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…