Axes.text¶
- Axes.text(*args, border=False, bordercolor='w', borderwidth=2, borderinvert=False, bbox=False, bboxcolor='w', bboxstyle='round', bboxalpha=0.5, bboxpad=None, fontfamily=None, family=None, fontname=None, name=None, fontsize=None, size=None, **kwargs)[source]¶
Add text to the axes.
- Parameters
x, y, [z] (
float) – The coordinates for the texts (
str) – The string for the text.transform (
{{'data', 'axes', 'figure'}}orTransform, optional) – The transform used to interpretxandy. This can be aTransformobject or a string corresponding totransData,transAxes, ortransFigure. Default is'data', i.e. the text is positioned in data coordinates.
- Other Parameters
border (
bool, optional) – Whether to draw border around text.borderwidth (
float, optional) – The width of the text border. Default is2points.bordercolor (
color-spec, optional) – The color of the text border. Default is'w'.borderinvert (
bool, optional) – IfTrue, 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 isrc['title.bboxpad']=None.name, fontname – Aliases for
family,fontfamily.family, fontfamily (
str, optional) – The font typeface name (e.g.,'Fira Math') or font family name (e.g.,'serif'). Matplotlib falls back to the system default if not found.size, fontsize (
floatorstr, optional) – The font size. If float, units are points. If string, interpreted byunits. This can also be a string indicating some scaling relative torc['font.size']. The sizes and scalings are shown below. The scalings'med','med-small', and'med-large'are added by ProPlot while the rest are native matplotlib sizes.Size
Scale
'xx-small'0.579
'x-small'0.694
'small','smaller'0.833
'med-small'0.9
'med','medium'1.0
'med-large'1.1
'large','larger'1.2
'x-large'1.440
'xx-large'1.728
'larger'1.2
**kwargs – Passed to
matplotlib.axes.Axes.text.
See also