Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7c0711c

Browse filesBrowse files
committed
TST: add a test
1 parent fe54ec1 commit 7c0711c
Copy full SHA for 7c0711c

File tree

Expand file treeCollapse file tree

1 file changed

+16
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+16
-0
lines changed

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,22 @@ def test_pcolornearest(fig_test, fig_ref):
12011201
ax.pcolormesh(x2, y2, Z, shading='nearest')
12021202

12031203

1204+
@check_figures_equal(extensions=["png"])
1205+
def test_pcolornearestunits(fig_test, fig_ref):
1206+
ax = fig_test.subplots()
1207+
x = [datetime.datetime.fromtimestamp(x * 3600) for x in range(10)]
1208+
y = np.arange(0, 3)
1209+
np.random.seed(19680801)
1210+
Z = np.random.randn(2, 9)
1211+
ax.pcolormesh(x, y, Z, shading='flat')
1212+
1213+
ax = fig_ref.subplots()
1214+
# specify the centers
1215+
x2 = [datetime.datetime.fromtimestamp((x + 0.5) * 3600) for x in range(9)]
1216+
y2 = y[:-1] + np.diff(y) / 2
1217+
ax.pcolormesh(x2, y2, Z, shading='nearest')
1218+
1219+
12041220
@check_figures_equal(extensions=["png"])
12051221
def test_pcolordropdata(fig_test, fig_ref):
12061222
ax = fig_test.subplots()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.