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

Function test_2dcolor_plot

lib/matplotlib/tests/test_axes.py:9202–9218  ·  view source on GitHub ↗
(fig_test, fig_ref)

Source from the content-addressed store, hash-verified

9200
9201@check_figures_equal(extensions=["pdf"])
9202def test_2dcolor_plot(fig_test, fig_ref):
9203 color = np.array([0.1, 0.2, 0.3])
9204 # plot with 1D-color:
9205 axs = fig_test.subplots(5)
9206 axs[0].plot([1, 2], [1, 2], c=color.reshape(-1))
9207 with pytest.warns(match="argument looks like a single numeric RGB"):
9208 axs[1].scatter([1, 2], [1, 2], c=color.reshape(-1))
9209 axs[2].step([1, 2], [1, 2], c=color.reshape(-1))
9210 axs[3].hist(np.arange(10), color=color.reshape(-1))
9211 axs[4].bar(np.arange(10), np.arange(10), color=color.reshape(-1))
9212 # plot with 2D-color:
9213 axs = fig_ref.subplots(5)
9214 axs[0].plot([1, 2], [1, 2], c=color.reshape((1, -1)))
9215 axs[1].scatter([1, 2], [1, 2], c=color.reshape((1, -1)))
9216 axs[2].step([1, 2], [1, 2], c=color.reshape((1, -1)))
9217 axs[3].hist(np.arange(10), color=color.reshape((1, -1)))
9218 axs[4].bar(np.arange(10), np.arange(10), color=color.reshape((1, -1)))
9219
9220
9221@check_figures_equal()

Callers

nothing calls this directly

Calls 6

stepMethod · 0.80
histMethod · 0.80
subplotsMethod · 0.45
plotMethod · 0.45
scatterMethod · 0.45
barMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…