__init__(self, xy, s, size=None, prop=None, _interpolation_steps=1, usetex=False)
Position of the text. For no offset, use xy=(0, 0)
.
The text to convert to a path.
Font size in points. Defaults to the size specified via the font properties prop.
Font property. If not provided, will use a default FontProperties
with parameters from the rcParams<customizing-with-dynamic-rc-settings>
.
(Currently ignored)
Whether to use tex rendering.
Create a path from the text. Note that it simply is a path, not an artist. You need to use the .PathPatch
(or other artists) to draw this path onto the canvas.
from matplotlib.textpath import TextPath from matplotlib.font_manager import FontProperties
fp = FontProperties(family="Helvetica", style="italic") path1 = TextPath((12, 12), "ABC", size=12, prop=fp) path2 = TextPath((0, 0), r"$\frac{1}{2}$", size=12, usetex=True)
Also see /gallery/text_labels_and_annotations/demo_text_path
.
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