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

Skip to content

Commit b8b693a

Browse files
Added test_hist
1 parent 414ed27 commit b8b693a

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lib/matplotlib/tests/test_datetime.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,18 @@ def test_hexbin(self):
170170
fig, ax = plt.subplots()
171171
ax.hexbin(...)
172172

173-
@pytest.mark.xfail(reason="Test for hist not written yet")
174173
@mpl.style.context("default")
175174
def test_hist(self):
176-
fig, ax = plt.subplots()
177-
ax.hist(...)
175+
mpl.rcParams["date.converter"] = "concise"
176+
N = 10
177+
fig, (ax1, ax2, ax3) = plt.subplots(
178+
3, 1, layout="constrained", figsize=(6, 10)
179+
)
180+
181+
x = np.array([datetime.datetime(2023, 9, n) for n in range(1, N)])
182+
ax1.hist(x, range(1, N))
183+
ax2.hist(range(1, N), x)
184+
ax3.hist(x, x)
178185

179186
@pytest.mark.xfail(reason="Test for hist2d not written yet")
180187
@mpl.style.context("default")

0 commit comments

Comments
 (0)