Skip to content

Commit 99b8061

Browse files
committed
Add a datetime test to images with units
1 parent 903018e commit 99b8061

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
@@ -305,6 +305,11 @@ def test_mappable_units(quantity_converter):
305305
cbar = fig.colorbar(mappable, ax=ax, extend="min")
306306

307307
# pcolor
308+
# Use datetime to check that the locator/formatter is set correctly
309+
data = [[datetime(2024, 1, 1), datetime(2024, 1, 2)],
310+
[datetime(2024, 1, 3), datetime(2024, 1, 4)]]
311+
vmin = datetime(2024, 1, 2)
312+
vmax = datetime(2024, 1, 5)
308313
ax = axs[0, 1]
309314
mappable = ax.pcolor(x, y, data, vmin=vmin, vmax=vmax)
310315
fig.colorbar(mappable, ax=ax, extend="min")

0 commit comments

Comments
 (0)