matplotlib 3.5.1

NotesParameters
draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None)

Notes

Note for backend implementers:

When you are trying to determine if you have gotten your bounding box right (which is what enables the text layout/alignment to work properly), it helps to change the line in text.py:

if 0: bbox_artist(self, renderer)

to if 1, and then the actual bounding box will be plotted along with your text.

Parameters

gc : `.GraphicsContextBase`

The graphics context.

x : float

The x location of the text in display coords.

y : float

The y location of the text baseline in display coords.

s : str

The text string.

prop : `matplotlib.font_manager.FontProperties`

The font properties.

angle : float

The rotation angle in degrees anti-clockwise.

mtext : `matplotlib.text.Text`

The original text object to be rendered.

Draw the text instance.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /matplotlib/backend_bases.py#515
type: <class 'function'>
Commit: