@@ -650,8 +650,7 @@ def secondary_yaxis(self, location, *, functions=None, **kwargs):
650
650
raise ValueError ('secondary_yaxis location must be either '
651
651
'a float or "left"/"right"' )
652
652
653
- @cbook ._delete_parameter ("3.1" , "withdash" )
654
- def text (self , x , y , s , fontdict = None , withdash = False , ** kwargs ):
653
+ def text (self , x , y , s , fontdict = None , ** kwargs ):
655
654
"""
656
655
Add text to the axes.
657
656
@@ -671,10 +670,6 @@ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
671
670
A dictionary to override the default text properties. If fontdict
672
671
is None, the defaults are determined by your rc parameters.
673
672
674
- withdash : bool, default: False
675
- Creates a `~matplotlib.text.TextWithDash` instance instead of a
676
- `~matplotlib.text.Text` instance.
677
-
678
673
Returns
679
674
-------
680
675
text : `.Text`
@@ -707,32 +702,15 @@ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
707
702
708
703
>>> text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))
709
704
"""
710
- if fontdict is None :
711
- fontdict = {}
712
-
713
705
effective_kwargs = {
714
706
'verticalalignment' : 'baseline' ,
715
707
'horizontalalignment' : 'left' ,
716
708
'transform' : self .transData ,
717
709
'clip_on' : False ,
718
- ** fontdict ,
710
+ ** ( fontdict if fontdict is not None else {}) ,
719
711
** kwargs ,
720
712
}
721
-
722
- # At some point if we feel confident that TextWithDash
723
- # is robust as a drop-in replacement for Text and that
724
- # the performance impact of the heavier-weight class
725
- # isn't too significant, it may make sense to eliminate
726
- # the withdash kwarg and simply delegate whether there's
727
- # a dash to TextWithDash and dashlength.
728
-
729
- if (withdash
730
- and withdash is not cbook .deprecation ._deprecated_parameter ):
731
- t = mtext .TextWithDash (x , y , text = s )
732
- else :
733
- t = mtext .Text (x , y , text = s )
734
- t .update (effective_kwargs )
735
-
713
+ t = mtext .Text (x , y , text = s , ** effective_kwargs )
736
714
t .set_clip_path (self .patch )
737
715
self ._add_text (t )
738
716
return t
0 commit comments