@@ -393,11 +393,33 @@ def test_streamplot(self):
393
393
fig , ax = plt .subplots ()
394
394
ax .streamplot (...)
395
395
396
- @pytest .mark .xfail (reason = "Test for text not written yet" )
397
396
@mpl .style .context ("default" )
398
397
def test_text (self ):
399
- fig , ax = plt .subplots ()
400
- ax .text (...)
398
+ mpl .rcParams ["date.converter" ] = 'concise'
399
+ fig , (ax1 , ax2 , ax3 ) = plt .subplots (3 , 1 , layout = "constrained" )
400
+
401
+ limit_value = 10
402
+ font_properties = {'family' : 'serif' , 'size' : 12 , 'weight' : 'bold' }
403
+ test_date = datetime .datetime (2023 , 10 , 1 )
404
+
405
+ x_data = np .array (range (1 , limit_value ))
406
+ y_data = np .array (range (1 , limit_value ))
407
+
408
+ x_dates = np .array (
409
+ [datetime .datetime (2023 , 10 , n ) for n in range (1 , limit_value )]
410
+ )
411
+ y_dates = np .array (
412
+ [datetime .datetime (2023 , 10 , n ) for n in range (1 , limit_value )]
413
+ )
414
+
415
+ ax1 .plot (x_dates , y_data )
416
+ ax1 .text (test_date , 5 , "Inserted Text" , ** font_properties )
417
+
418
+ ax2 .plot (x_data , y_dates )
419
+ ax2 .text (7 , test_date , "Inserted Text" , ** font_properties )
420
+
421
+ ax3 .plot (x_dates , y_dates )
422
+ ax3 .text (test_date , test_date , "Inserted Text" , ** font_properties )
401
423
402
424
@pytest .mark .xfail (reason = "Test for tricontour not written yet" )
403
425
@mpl .style .context ("default" )
0 commit comments