Skip to content

Commit 3402631

Browse files
committed
raising revision for test_bar in test_datetime.py
1 parent 37f8d75 commit 3402631

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

lib/matplotlib/tests/test_datetime.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,23 @@ def test_axvspan(self):
6060
def test_bar(self):
6161
mpl.rcParams["date.converter"] = "concise"
6262
range_threshold = 10
63-
fig, (ax1, ax2, ax3) = plt.subplots(3, 1, layout="constrained")
63+
fig, (ax1, ax2, ax3, ax4) = plt.subplots(4, 1, layout="constrained")
6464

6565
x_dates = np.array(
66-
[datetime.datetime(2023, 10, delta) for delta in range(1, range_threshold)]
66+
[datetime.datetime(2023, 10, delta) for delta in range(1, range_threshold)],
67+
dtype=np.datetime64,
6768
)
6869
y_dates = np.array(
69-
[datetime.datetime(2023, 10, delta) for delta in range(1, range_threshold)]
70+
[datetime.datetime(2023, 10, delta) for delta in range(1, range_threshold)],
71+
dtype=np.datetime64,
7072
)
7173
x_ranges = np.array(range(1, range_threshold))
7274
y_ranges = np.array(range(1, range_threshold))
7375

74-
ax1.bar(x_dates, y_ranges)
75-
ax2.bar(x_dates, y_dates)
76-
ax3.bar(x_ranges, y_dates)
76+
ax1.bar(x_dates, y_ranges, width=np.timedelta64(range_threshold, "D"))
77+
ax2.bar(x_dates, y_dates, width=np.timedelta64(range_threshold, "D"))
78+
ax3.bar(x_ranges, y_dates, width=np.timedelta64(range_threshold, "D"))
79+
ax4.bar(x_ranges, y_ranges, bottom=datetime.datetime(2023, 10, 1))
7780

7881
@pytest.mark.xfail(reason="Test for bar_label not written yet")
7982
@mpl.style.context("default")

0 commit comments

Comments
 (0)