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

Function test_contour_addlines

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

Source from the content-addressed store, hash-verified

446# tolerance is because image changed minutely when tick finding on
447# colorbars was cleaned up...
448def test_contour_addlines():
449 # Remove this line when this test image is regenerated.
450 plt.rcParams['pcolormesh.snap'] = False
451
452 fig, ax = plt.subplots()
453 np.random.seed(19680812)
454 X = np.random.rand(10, 10)*10000
455 pcm = ax.pcolormesh(X)
456 # add 1000 to make colors visible...
457 cont = ax.contour(X+1000)
458 cb = fig.colorbar(pcm)
459 cb.add_lines(cont)
460 assert_array_almost_equal(cb.ax.get_ylim(), [114.3091, 9972.30735], 3)
461
462
463@image_comparison(['contour_uneven.png'], remove_text=True, style='mpl20')

Callers

nothing calls this directly

Calls 6

pcolormeshMethod · 0.80
add_linesMethod · 0.80
subplotsMethod · 0.45
contourMethod · 0.45
colorbarMethod · 0.45
get_ylimMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…