text_wrapper¶
-
text_wrapper
(self, func, x=0, y=0, text='', transform='data', fontfamily=None, fontname=None, fontsize=None, size=None, border=False, bordercolor='w', borderwidth=2, borderinvert=False, **kwargs)[source]¶ Wraps
text
, and enables specifyingtranform
with a string name and adds feature for drawing borders around text.- Parameters
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 interpretx
andy
. Can be aTransform
object or a string representing thetransData
,transAxes
, ortransFigure
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.
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.
- Other Parameters
**kwargs – Passed to
Text
instantiator.