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

Function test_contour_colorbar

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

Source from the content-addressed store, hash-verified

2852@image_comparison(['contour_colorbar'], style='mpl20',
2853 tol=0 if platform.machine() == 'x86_64' else 0.54)
2854def test_contour_colorbar():
2855 x, y, z = contour_dat()
2856
2857 fig, ax = plt.subplots()
2858 cs = ax.contourf(x, y, z, levels=np.arange(-1.8, 1.801, 0.2),
2859 cmap=mpl.colormaps['RdBu'],
2860 vmin=-0.6,
2861 vmax=0.6,
2862 extend='both')
2863 cs1 = ax.contour(x, y, z, levels=np.arange(-2.2, -0.599, 0.2),
2864 colors=['y'],
2865 linestyles='solid',
2866 linewidths=2)
2867 cs2 = ax.contour(x, y, z, levels=np.arange(0.6, 2.2, 0.2),
2868 colors=['c'],
2869 linewidths=2)
2870 cbar = fig.colorbar(cs, ax=ax)
2871 cbar.add_lines(cs1)
2872 cbar.add_lines(cs2, erase=False)
2873
2874
2875@image_comparison(['hist2d.png', 'hist2d.png'], remove_text=True, style='mpl20')

Callers

nothing calls this directly

Calls 6

contour_datFunction · 0.85
add_linesMethod · 0.80
subplotsMethod · 0.45
contourfMethod · 0.45
contourMethod · 0.45
colorbarMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…