Skip to content

DOC: Minor improvements on VPacker, HPacker, PaddedBox docs #29389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions lib/matplotlib/offsetbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,14 @@ class VPacker(PackerBase):
"""
VPacker packs its children vertically, automatically adjusting their
relative positions at draw time.

.. code-block:: none

+---------+
| Child 1 |
| Child 2 |
| Child 3 |
+---------+
"""

def _get_bbox_and_child_offsets(self, renderer):
Expand Down Expand Up @@ -468,6 +476,12 @@ class HPacker(PackerBase):
"""
HPacker packs its children horizontally, automatically adjusting their
relative positions at draw time.

.. code-block:: none

+-------------------------------+
| Child 1 Child 2 Child 3 |
+-------------------------------+
"""

def _get_bbox_and_child_offsets(self, renderer):
Expand Down Expand Up @@ -498,6 +512,26 @@ class PaddedBox(OffsetBox):

The `.PaddedBox` contains a `.FancyBboxPatch` that is used to visualize
it when rendering.

.. code-block:: none

+----------------------------+
| |
| |
| |
| <--pad--> Artist |
| ^ |
| pad |
| v |
+----------------------------+

Attributes
----------
pad : float
The padding in points.
patch : `.FancyBboxPatch`
When *draw_frame* is True, this `.FancyBboxPatch` is made visible and
creates a border around the box.
"""

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