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

Skip to content

Commit 18358eb

Browse files
committed
Add test for parameters width and left
1 parent 100ca9b commit 18358eb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/tests/test_datetime.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,13 @@ def test_barh(self):
8181
base = datetime.datetime(1970, 1, 1)
8282
indices = np.arange(N)
8383
dates = [base + datetime.timedelta(days=(7 * i)) for i in range(N)]
84-
fig, (ax1, ax2, ax3) = plt.subplots(3, 1, layout='constrained')
84+
widths = [datetime.timedelta(days=(7*i)) for i in range(N)]
85+
fig, (ax1, ax2, ax3, ax4) = plt.subplots(4, 1, layout='constrained')
8586
error = np.random.rand(N)
8687
ax1.barh(indices, dates, xerr=error)
8788
ax2.barh(dates, indices)
8889
ax3.barh(dates, dates)
90+
ax4.barh(indices, width=widths, left=base)
8991

9092
@pytest.mark.xfail(reason="Test for boxplot not written yet")
9193
@mpl.style.context("default")

0 commit comments

Comments
 (0)