4343
4444import matplotlib as mpl
4545from matplotlib import (
46- _api , backend_tools as tools , cbook , colors , _docstring , textpath ,
46+ _api , backend_tools as tools , cbook , colors , _docstring , text ,
4747 _tight_bbox , transforms , widgets , get_backend , is_interactive , rcParams )
4848from matplotlib ._pylab_helpers import Gcf
4949from matplotlib .backend_managers import ToolManager
@@ -172,7 +172,7 @@ class RendererBase:
172172 def __init__ (self ):
173173 super ().__init__ ()
174174 self ._texmanager = None
175- self ._text2path = textpath .TextToPath ()
175+ self ._text2path = text .TextToPath ()
176176 self ._raster_depth = 0
177177 self ._rasterizing = False
178178
@@ -525,6 +525,8 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
525525 The font properties.
526526 angle : float
527527 The rotation angle in degrees anti-clockwise.
528+ ismath : bool or "TeX"
529+ If True, use mathtext parser. If "TeX", use tex for rendering.
528530 mtext : `matplotlib.text.Text`
529531 The original text object to be rendered.
530532
@@ -550,12 +552,18 @@ def _get_text_path_transform(self, x, y, s, prop, angle, ismath):
550552
551553 Parameters
552554 ----------
553- prop : `matplotlib.font_manager.FontProperties`
554- The font property.
555+ x : float
556+ The x location of the text in display coords.
557+ y : float
558+ The y location of the text baseline in display coords.
555559 s : str
556560 The text to be converted.
561+ prop : `matplotlib.font_manager.FontProperties`
562+ The font property.
563+ angle : float
564+ Angle in degrees to render the text at.
557565 ismath : bool or "TeX"
558- If True, use mathtext parser. If "TeX", use *usetex* mode .
566+ If True, use mathtext parser. If "TeX", use tex for rendering .
559567 """
560568
561569 text2path = self ._text2path
@@ -580,18 +588,22 @@ def _get_text_path_transform(self, x, y, s, prop, angle, ismath):
580588
581589 def _draw_text_as_path (self , gc , x , y , s , prop , angle , ismath ):
582590 """
583- Draw the text by converting them to paths using textpath module .
591+ Draw the text by converting them to paths using `.TextToPath` .
584592
585593 Parameters
586594 ----------
587- prop : `matplotlib.font_manager.FontProperties`
588- The font property.
595+ x : float
596+ The x location of the text in display coords.
597+ y : float
598+ The y location of the text baseline in display coords.
589599 s : str
590600 The text to be converted.
591- usetex : bool
592- Whether to use usetex mode.
601+ prop : `matplotlib.font_manager.FontProperties`
602+ The font property.
603+ angle : float
604+ Angle in degrees to render the text at.
593605 ismath : bool or "TeX"
594- If True, use mathtext parser. If "TeX", use *usetex* mode .
606+ If True, use mathtext parser. If "TeX", use tex for rendering .
595607 """
596608 path , transform = self ._get_text_path_transform (
597609 x , y , s , prop , angle , ismath )
0 commit comments