Skip to content

Commit 34230a7

Browse files
committed
TST: Added test for inverted limit with autodatelocator
1 parent a6dc25d commit 34230a7

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

lib/matplotlib/tests/test_dates.py

+15
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,21 @@ def _create_auto_date_locator(date1, date2):
288288
expected)
289289

290290

291+
@image_comparison(baseline_images=['date_inverted_limit'],
292+
extensions=['png'])
293+
def test_date_inverted_limit():
294+
# test ax hline with date inputs
295+
t0 = datetime.datetime(2009, 1, 20)
296+
tf = datetime.datetime(2009, 1, 31)
297+
fig = plt.figure()
298+
ax = fig.add_subplot(1, 1, 1)
299+
ax.axhline(t0, color="blue", lw=3)
300+
ax.set_ylim(t0 - datetime.timedelta(days=5),
301+
tf + datetime.timedelta(days=5))
302+
ax.invert_yaxis()
303+
fig.subplots_adjust(left=0.25)
304+
305+
291306
if __name__ == '__main__':
292307
import nose
293308
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)

0 commit comments

Comments
 (0)