8000 TST: add test for eventplot · matplotlib/matplotlib@a94fca0 · GitHub
[go: up one dir, main page]

Skip to content

Commit a94fca0

Browse files
committed
TST: add test for eventplot
1 parent 4807aba commit a94fca0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4137,6 +4137,21 @@ def test_eventplot_orientation(data, orientation):
41374137
plt.draw()
41384138

41394139

4140+
@check_figures_equal(extensions=['png'])
4141+
def test_eventplot_units_list(fig_test, fig_ref):
4142+
# test that list of lists converted properly:
4143+
ts_1 = [datetime.datetime(2021, 1, 1), datetime.datetime(2021, 1, 2),
4144+
datetime.datetime(2021, 1, 3)]
4145+
ts_2 = [datetime.datetime(2021, 1, 15), datetime.datetime(2021, 1, 16)]
4146+
4147+
ax = fig_ref.subplots()
4148+
ax.eventplot(ts_1, lineoffsets=0)
4149+
ax.eventplot(ts_2, lineoffsets=1)
4150+
4151+
ax = fig_test.subplots()
4152+
ax.eventplot([ts_1, ts_2])
4153+
4154+
41404155
@image_comparison(['marker_styles.png'], remove_text=True)
41414156
def test_marker_styles():
41424157
fig, ax = plt.subplots()

0 commit comments

Comments
 (0)
0