text_wrapper(self, func, x=0, y=0, text='', transform='data', fontfamily=None, fontname=None, fontsize=None, size=None, border=False, bordercolor='w', invert=False, lw=None, linewidth=2, **kwargs)[source]

Wraps text, and enables specifying tranform with a string name and adds feature for drawing borders around text.

  • x, y (float) – The x and y coordinates for the text.

  • text (str) – The text string.

  • transform ({‘data’, ‘axes’, ‘figure’} or Transform, optional) – The transform used to interpret x and y. Can be a Transform object or a string representing the transData, transAxes, or transFigure transforms. Default is 'data', i.e. the text is positioned in data coordinates.

  • size, fontsize (float or str, optional) – The font size. If float, units are inches. If string, units are interpreted by units.

  • fontname, fontfamily (str, optional) – Aliases for the fontfamily Text property.

  • border (bool, optional) – Whether to draw border around text.

  • bordercolor (color-spec, optional) – The color of the border. Default is 'w'.

  • invert (bool, optional) – If False, 'color' is used for the text and bordercolor for the border. If True, this is inverted.

  • lw, linewidth (float, optional) – Ignored if border is False. The width of the text border.

Other Parameters

**kwargs – Passed to Text instantiator.