text_extras

text_extras(self, x=0, y=0, s='', transform='data', *, family=None, fontfamily=None, fontname=None, fontsize=None, size=None, border=False, bordercolor='w', borderwidth=2, borderinvert=False, bbox=False, bboxcolor='w', bboxstyle='round', bboxalpha=0.5, bboxpad=None, **kwargs)[source]

Enables specifying tranform with a string name and adds a feature for drawing borders and bbox around text.

Important

This function wraps text.

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

  • s (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 corresponding to transData, transAxes, or transFigure transforms. Default is 'data', i.e. the text is positioned in data coordinates.

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

  • fontname, fontfamily, family (str, optional) – The font name (e.g. 'Fira Math') or font family name (e.g. 'serif'). Matplotlib falls back to the system default if not found.

  • fontweight, weight, fontstyle, style, fontvariant, variant (str, optional) – Additional font properties. See Text for details.

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

  • borderwidth (float, optional) – The width of the text border. Default is 2 points.

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

  • borderinvert (bool, optional) – If True, the text and border colors are swapped.

  • bbox (bool, optional) – Whether to draw a bounding box around text.

  • bboxcolor (color-spec, optional) – The color of the text bounding box. Default is 'w'.

  • bboxstyle (boxstyle, optional) – The style of the bounding box. Default is 'round'.

  • bboxalpha (float, optional) – The alpha for the bounding box. Default is '0.5'.

  • bboxpad (float, optional) – The padding for the bounding box. Default is rc[‘title.bboxpad’] = None.

Other Parameters

**kwargs – Passed to text.