Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff5d001

Browse files
committed
Add a datetime test to images with units
1 parent 5ddfbac commit ff5d001

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/matplotlib/tests/test_units.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,11 @@ def test_mappable_units(quantity_converter):
316316
cbar = fig.colorbar(mappable, ax=ax, extend="min")
317317

318318
# pcolor
319+
# Use datetime to check that the locator/formatter is set correctly
320+
data = [[datetime(2024, 1, 1), datetime(2024, 1, 2)],
321+
[datetime(2024, 1, 3), datetime(2024, 1, 4)]]
322+
vmin = datetime(2024, 1, 2)
323+
vmax = datetime(2024, 1, 5)
319324
ax = axs[0, 1]
320325
mappable = ax.pcolor(x, y, data, vmin=vmin, vmax=vmax)
321326
fig.colorbar(mappable, ax=ax, extend="min")

0 commit comments

Comments
 (0)