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

Skip to content

Commit 084850b

Browse files
committed
Add a datetime test to images with units
1 parent 794b4ed commit 084850b

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

326326
# pcolor
327+
# Use datetime to check that the locator/formatter is set correctly
328+
data = [[datetime(2024, 1, 1), datetime(2024, 1, 2)],
329+
[datetime(2024, 1, 3), datetime(2024, 1, 4)]]
330+
vmin = datetime(2024, 1, 2)
331+
vmax = datetime(2024, 1, 5)
327332
ax = axs[0, 1]
328333
mappable = ax.pcolor(x, y, data, vmin=vmin, vmax=vmax)
329334
fig.colorbar(mappable, ax=ax, extend="min")

0 commit comments

Comments
 (0)