MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / draw_bbox

Function draw_bbox

lib/matplotlib/patches.py:2379–2389  ·  view source on GitHub ↗

A debug function to draw a rectangle around the bounding box returned by an artist's `.Artist.get_window_extent` to test whether the artist is returning the correct bbox.

(bbox, renderer, color='k', trans=None)

Source from the content-addressed store, hash-verified

2377
2378
2379def draw_bbox(bbox, renderer, color='k', trans=None):
2380 """
2381 A debug function to draw a rectangle around the bounding
2382 box returned by an artist's `.Artist.get_window_extent`
2383 to test whether the artist is returning the correct bbox.
2384 """
2385 r = Rectangle(xy=bbox.p0, width=bbox.width, height=bbox.height,
2386 edgecolor=color, fill=False, clip_on=False)
2387 if trans is not None:
2388 r.set_transform(trans)
2389 r.draw(renderer)
2390
2391
2392class _Style:

Callers

nothing calls this directly

Calls 3

RectangleClass · 0.85
set_transformMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…