8000 Simplified example code and added arguments for xmin and xmax · matplotlib/matplotlib@0c2f104 · GitHub
[go: up one dir, main page]

Skip to content
< 8000 script crossorigin="anonymous" type="application/javascript" src="https://github.githubassets.com/assets/sessions-eed3aa0554dd.js" defer="defer">

Commit 0c2f104

Browse files
committed
Simplified example code and added arguments for xmin and xmax
1 parent 8c55381 commit 0c2f104

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

lib/matplotlib/tests/test_datetime.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,7 @@ def test_arrow(self):
3131
def test_axhline(self):
3232
mpl.rcParams["date.converter"] = 'concise'
3333
fig, ax = plt.subplots(layout='constrained')
34-
birth_date = np.array([datetime.datetime(2020, 4, 10),
35-
datetime.datetime(2020, 5, 30),
36-
datetime.datetime(2020, 10, 12),
37-
datetime.datetime(2020, 11, 15)])
38-
year_start = datetime.datetime(2020, 1, 1)
39-
year_end = datetime.datetime(2020, 12, 31)
40-
age = [21, 53, 20, 24]
41-
ax.set_xlabel('Birth Date')
42-
ax.set_ylabel('Age')
43-
ax.set_ylim(bottom=year_start, top=year_end)
44-
ax.bar(x=age, height=birth_date)
45-
ax.axhline(y=datetime.datetime(2020, 6, 1))
34+
ax.axhline(y=datetime.datetime(2020, 6, 1), xmin=0.2, xmax=0.8)
4635

4736
@pytest.mark.xfail(reason="Test for axhspan not written yet")
4837
@mpl.style.context("default")

0 commit comments

Comments
 (0)
0