@@ -650,8 +650,7 @@ def secondary_yaxis(self, location, *, functions=None, **kwargs):
650650 raise ValueError ('secondary_yaxis location must be either '
651651 'a float or "left"/"right"' )
652652
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 ):
655654 """
656655 Add text to the axes.
657656
@@ -671,10 +670,6 @@ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
671670 A dictionary to override the default text properties. If fontdict
672671 is None, the defaults are determined by your rc parameters.
673672
674- withdash : bool, default: False
675- Creates a `~matplotlib.text.TextWithDash` instance instead of a
676- `~matplotlib.text.Text` instance.
677-
678673 Returns
679674 -------
680675 text : `.Text`
@@ -707,32 +702,15 @@ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
707702
708703 >>> text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))
709704 """
710- if fontdict is None :
711- fontdict = {}
712-
713705 effective_kwargs = {
714706 'verticalalignment' : 'baseline' ,
715707 'horizontalalignment' : 'left' ,
716708 'transform' : self .transData ,
717709 'clip_on' : False ,
718- ** fontdict ,
710+ ** ( fontdict if fontdict is not None else {}) ,
719711 ** kwargs ,
720712 }
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 )
736714 t .set_clip_path (self .patch )
737715 self ._add_text (t )
738716 return t
0 commit comments