get_window_extent(self, renderer=None, dpi=None)
In addition to being used internally, this is useful for specifying clickable regions in a png file on a web page.
A renderer is needed to compute the bounding box. If the artist has already been drawn, the renderer is cached; thus, it is only necessary to pass this argument when calling get_window_extent
before the first draw
. In practice, it is usually easier to trigger a draw first (e.g. by saving the figure).
The dpi value for computing the bbox, defaults to self.figure.dpi
(not the renderer dpi); should be set e.g. if to match regions with a figure saved with a custom dpi value.
Return the .Bbox
bounding the text, in display units.
The following pages refer to to this document either explicitly or contain code examples using this.
matplotlib.text._get_textbox
matplotlib.text.Text.get_window_extent
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