@@ -14,11 +14,25 @@ def test_acorr(self):
14
14
fig ,ax = plt .subplots ()
15
15
ax .acorr (...)
16
16
17
- @pytest .mark .xfail (reason = "Test for annotate not written yet" )
18
17
@mpl .style .context ("default" )
19
18
def test_annotate (self ):
20
- fig ,ax = plt .subplots ()
21
- ax .annotate (...)
19
+ mpl .rcParams ["date.converter" ]= 'concise'
20
+ fig , (ax1 ,ax2 ,ax3 ,ax4 )= plt .subplots (4 ,1 ,layout = "constrained" )
21
+
22
+ start_date = datetime .datetime (2023 ,10 ,1 )
23
+ dates = [start_date + datetime .timedelta (days = i )for i in range (31 )]
24
+ data = list (range (1 ,32 ))
25
+ test_text = "Test Text"
26
+
27
+ ax1 .plot (dates ,data )
28
+ ax1 .annotate (text = test_text ,xy = (dates [15 ],data [15 ]))
29
+ ax2 .plot (data ,dates )
30
+ ax2 .annotate (text = test_text ,xy = (data [5 ],dates [26 ]))
31
+ ax3 .plot (dates ,dates )
32
+ ax3 .annotate (text = test_text ,xy = (dates [15 ],dates [3 ]))
33
+ ax4 .plot (dates ,dates )
34
+ ax4 .annotate (text = test_text ,xy = (dates [5 ],dates [30 ]),
35
+ xytext = (dates [1 ],dates [7 ]),arrowprops = dict (facecolor = 'red' ))
22
36
23
37
@pytest .mark .xfail (reason = "Test for arrow not written yet" )
24
38
@mpl .style .context ("default" )