Module plottools.text

Enhance textual annotations.

Enhanced axes member functions

  • text(): text function with slope parameter and LaTeX support.

Settings

Install/uninstall text functions

You usually do not need to call these functions. Upon loading the text module, install_text() is called automatically.

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 : float or None
Slope to which the text should be rotated. If not otherwise specified set rotation_mode to '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 None are 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 color or 'axes'
Color of text. If 'axes' set to color of axes (rcParam axes.edgecolor). Sets rcParam text.color.
latex : boolean
Use LaTeX for setting text and enable unicode support when set to True (rcParam text.usetex).
preamble : sequence of strings
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()

Patch the mpl.axes.Axes.text() function.

See Also

uninstall_text()

def uninstall_text()

Uninstall code for text.

Call this code to disable anything that was installed by install_text().

See Also

install_text()

def demo(usetex=False)

Run a demonstration of the text module.

Parameters

usetex : bool
If True use LaTeX mode.