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)
| 2377 | |
| 2378 | |
| 2379 | def 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 | |
| 2392 | class _Style: |
nothing calls this directly
no test coverage detected
searching dependent graphs…