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

Skip to content

Commit bc118a9

Browse files
Added test_hist
1 parent a99673c commit bc118a9

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

lib/matplotlib/tests/test_datetime.py

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

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

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

0 commit comments

Comments
 (0)