Skip to content

Commit ba332c0

Browse files
authored
Merge pull request #29390 from meeseeksmachine/auto-backport-of-pr-29389-on-v3.10.x
Backport PR #29389 on branch v3.10.x (DOC: Minor improvements on VPacker, HPacker, PaddedBox docs)
2 parents 058bf47 + f8d3916 commit ba332c0

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

lib/matplotlib/offsetbox.py

+34
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,14 @@ class VPacker(PackerBase):
436436
"""
437437
VPacker packs its children vertically, automatically adjusting their
438438
relative positions at draw time.
439+
440+
.. code-block:: none
441+
442+
+---------+
443+
| Child 1 |
444+
| Child 2 |
445+
| Child 3 |
446+
+---------+
439447
"""
440448

441449
def _get_bbox_and_child_offsets(self, renderer):
@@ -468,6 +476,12 @@ class HPacker(PackerBase):
468476
"""
469477
HPacker packs its children horizontally, automatically adjusting their
470478
relative positions at draw time.
479+
480+
.. code-block:: none
481+
482+
+-------------------------------+
483+
| Child 1 Child 2 Child 3 |
484+
+-------------------------------+
471485
"""
472486

473487
def _get_bbox_and_child_offsets(self, renderer):
@@ -498,6 +512,26 @@ class PaddedBox(OffsetBox):
498512
499513
The `.PaddedBox` contains a `.FancyBboxPatch` that is used to visualize
500514
it when rendering.
515+
516+
.. code-block:: none
517+
518+
+----------------------------+
519+
| |
520+
| |
521+
| |
522+
| <--pad--> Artist |
523+
| ^ |
524+
| pad |
525+
| v |
526+
+----------------------------+
527+
528+
Attributes
529+
----------
530+
pad : float
531+
The padding in points.
532+
patch : `.FancyBboxPatch`
533+
When *draw_frame* is True, this `.FancyBboxPatch` is made visible and
534+
creates a border around the box.
501535
"""
502536

503537
def __init__(self, child, pad=0., *, draw_frame=False, patch_attrs=None):

0 commit comments

Comments
 (0)