Module plottools.text
Enhance textual annotations.
Enhanced axes member functions
text(): text function with slope parameter and LaTeX support.
Settings
text_params(): set default parameter for the text module.
Install/uninstall text functions
You usually do not need to call these functions. Upon loading the text
module, install_text() is called automatically.
install_text(): install functions of the text module in matplotlib.uninstall_text(): uninstall all code of the text module from matplotlib.
Functions
def text(ax, x, y, s, *args, slope=None, **kwargs)-
Text function with slope parameter and LaTeX support.
Adds an optional slope parameter that rotates the text to a specified slope. Uses
latex.translate_latex_text()to improve LaTeX mode.Parameters
Same as
mpl.axes.Axes.text().slope:floatorNone- Slope to which the text should be rotated. If not otherwise specified set
rotation_modeto 'anchor'.
def text_params(font_size=None, font_family=None, color='axes', latex=None, preamble=None)-
Set default parameter for the text module.
Only parameters that are not
Noneare updated.Call this function before you create any matplotlib figure.
Parameters
font_size:float- Set font size for text in points (rcParam
font.size). font_family:string- Set name of font to be used (rcParam
font.family). color:matplotlib coloror'axes'- Color of text. If 'axes' set to color of axes (rcParam
axes.edgecolor). Sets rcParamtext.color. latex:boolean- Use LaTeX for setting text and enable unicode support
when set to
True(rcParamtext.usetex). preamble:sequenceofstrings- Lines for the latex preamble (rcParam
text.latex.preamble). For convinience, strings starting with 'p:xxx' are translated into '\usepackage{xxx}', strings starting with 'p:[yyy]xxx' are translated into '\usepackage[yyy]{xxx}'.
def install_text()def uninstall_text()-
Uninstall code for text.
Call this code to disable anything that was installed by
install_text().See Also
def demo(usetex=False)-
Run a demonstration of the text module.
Parameters
usetex:bool- If
Trueuse LaTeX mode.