Skip to content

Commit f2717a5

Browse files
authored
Merge pull request #29389 from timhoffm/doc-offsetbox
DOC: Minor improvements on VPacker, HPacker, PaddedBox docs
2 parents 2f75888 + e845d5a commit f2717a5

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

lib/matplotlib/offsetbox.py

Lines changed: 34 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy