| 9200 | |
| 9201 | @check_figures_equal(extensions=["pdf"]) |
| 9202 | def 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() |