@@ -355,11 +355,33 @@ def test_streamplot(self):
355
355
fig , ax = plt .subplots ()
356
356
ax .streamplot (...)
357
357
358
- @pytest .mark .xfail (reason = "Test for text not written yet" )
359
358
@mpl .style .context ("default" )
360
359
def test_text (self ):
361
- fig , ax = plt .subplots ()
362
- ax .text (...)
360
+ mpl .rcParams ["date.converter" ] = 'concise'
361
+ fig , (ax1 , ax2 , ax3 ) = plt .subplots (3 , 1 , layout = "constrained" )
362
+
363
+ limit_value = 10
364
+ font_properties = {'family' : 'serif' , 'size' : 12 , 'weight' : 'bold' }
365
+ test_date = datetime .datetime (2023 , 10 , 1 )
366
+
367
+ x_data = np .array (range (1 , limit_value ))
368
+ y_data = np .array (range (1 , limit_value ))
369
+
370
+ x_dates = np .array (
371
+ [datetime .datetime (2023 , 10 , n ) for n in range (1 , limit_value )]
372
+ )
373
+ y_dates = np .array (
374
+ [datetime .datetime (2023 , 10 , n ) for n in range (1 , limit_value )]
375
+ )
376
+
377
+ ax1 .plot (x_dates , y_data )
378
+ ax1 .text (test_date , 5 , "Inserted Text" , ** font_properties )
379
+
380
+ ax2 .plot (x_data , y_dates )
381
+ ax2 .text (7 , test_date , "Inserted Text" , ** font_properties )
382
+
383
+ ax3 .plot (x_dates , y_dates )
384
+ ax3 .text (test_date , test_date , "Inserted Text" , ** font_properties )
363
385
364
386
@pytest .mark .xfail (reason = "Test for tricontour not written yet" )
365
387
@mpl .style .context ("default" )
0 commit comments