diff --git a/lib/matplotlib/tests/test_datetime.py b/lib/matplotlib/tests/test_datetime.py index 316be793e47c..f7fd3e2a6623 100644 --- a/lib/matplotlib/tests/test_datetime.py +++ b/lib/matplotlib/tests/test_datetime.py @@ -399,11 +399,20 @@ def test_matshow(self): fig, ax = plt.subplots() ax.matshow(...) - @pytest.mark.xfail(reason="Test for pcolor not written yet") @mpl.style.context("default") def test_pcolor(self): - fig, ax = plt.subplots() - ax.pcolor(...) + base_date = datetime.date(2020, 1, 1) + dates = [base_date + datetime.timedelta(days=i) for i in range(10)] + data = np.random.rand(10, 10) + data = np.sort(data, axis=0) + fig, ax = plt.subplots() + c = ax.pcolor(data, cmap='viridis') + ax.set_title('Pseudocolor Plot with Datetime Data') + ax.set_xticks(range(len(dates))) + ax.set_xticklabels([d.strftime('%Y-%m-%d') for d in dates], rotation=45) + fig.colorbar(c, ax=ax) + fig.tight_layout() + plt.close(fig) @pytest.mark.xfail(reason="Test for pcolorfast not written yet") @mpl.style.context("default")
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: