*pad* : boundary pad .. note:: *pad* need to given in points and will be scale with the renderer dpi, while *width* and *height* need to be in pixels.
(self, child, pad=None, draw_frame=False, patch_attrs=None)
| 470 | |
| 471 | class PaddedBox(OffsetBox): |
| 472 | def __init__(self, child, pad=None, draw_frame=False, patch_attrs=None): |
| 473 | """ |
| 474 | *pad* : boundary pad |
| 475 | |
| 476 | .. note:: |
| 477 | *pad* need to given in points and will be |
| 478 | scale with the renderer dpi, while *width* and *height* |
| 479 | need to be in pixels. |
| 480 | """ |
| 481 | |
| 482 | super().__init__() |
| 483 | |
| 484 | self.pad = pad |
| 485 | self._children = [child] |
| 486 | |
| 487 | self.patch = FancyBboxPatch( |
| 488 | xy=(0.0, 0.0), width=1., height=1., |
| 489 | facecolor='w', edgecolor='k', |
| 490 | mutation_scale=1, # self.prop.get_size_in_points(), |
| 491 | snap=True |
| 492 | ) |
| 493 | |
| 494 | self.patch.set_boxstyle("square", pad=0) |
| 495 | |
| 496 | if patch_attrs is not None: |
| 497 | self.patch.update(patch_attrs) |
| 498 | |
| 499 | self._drawFrame = draw_frame |
| 500 | |
| 501 | def get_extent_offsets(self, renderer): |
| 502 | """ |
nothing calls this directly
no test coverage detected