Axes.text¶
- Axes.text(*args, border=False, bbox=False, bordercolor='w', borderwidth=2, borderinvert=False, borderstyle='miter', bboxcolor='w', bboxstyle='round', bboxalpha=0.5, bboxpad=None, **kwargs)[source]¶
Add text to the axes.
- Parameters
x, y, [z] (
float) – The coordinates for the text.ThreeAxesaccept an optional third coordinate. If only two are provided this automatically redirects to thetext2Dmethod.s, text (
str) – The string for the text.transform (
{'data', 'axes', 'figure'}orTransform, optional) – The transform used to interpret the bounds. Can be aTransforminstance or a string representing thetransData,transAxes, ortransFiguretransforms. Default is'axes', i.e.boundsis in axes-relative 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.borderstyle (
{'miter', 'round', 'bevel'}, optional) – The line join style used for the border.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 is0.5.bboxpad (
float, optional) – The padding for the bounding box. Default isrc['title.bboxpad']=None.name, fontname, 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 (
unit-specorstr, 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