@@ -367,9 +367,8 @@ def draw(self, renderer):
367
367
368
368
class PackerBase (OffsetBox ):
369
369
def __init__ (self , pad = None , sep = None , width = None , height = None ,
370
- align = None , mode = None ,
371
- children = None ):
372
- r"""
370
+ align = "baseline" , mode = "fixed" , children = None ):
371
+ """
373
372
Parameters
374
373
----------
375
374
pad : float, optional
@@ -382,13 +381,14 @@ def __init__(self, pad=None, sep=None, width=None, height=None,
382
381
Width and height of the container box in pixels, calculated if
383
382
*None*.
384
383
385
- align : {'top', 'bottom', 'left', 'right', 'center', 'baseline'}
384
+ align : {'top', 'bottom', 'left', 'right', 'center', 'baseline'}, \
385
+ default: 'baseline'
386
386
Alignment of boxes.
387
387
388
- mode : {'fixed', 'expand', 'equal'}
388
+ mode : {'fixed', 'expand', 'equal'}, default: 'fixed'
389
389
The packing mode.
390
390
391
- - 'fixed' packs the given `.Artist`\s tight with *sep* spacing.
391
+ - 'fixed' packs the given `.Artist`\\ s tight with *sep* spacing.
392
392
- 'expand' uses the maximal available space to distribute the
393
393
artists with equal spacing in between.
394
394
- 'equal': Each artist an equal fraction of the available space
@@ -403,59 +403,20 @@ def __init__(self, pad=None, sep=None, width=None, height=None,
403
403
dpi, while *width* and *height* are in in pixels.
404
404
"""
405
405
super ().__init__ ()
406
-
407
406
self .height = height
408
407
self .width = width
409
408
self .sep = sep
410
409
self .pad = pad
411
410
self .mode = mode
412
411
self .align = align
413
-
414
412
self ._children = children
415
413
416
414
417
415
class VPacker (PackerBase ):
418
416
"""
419
- The VPacker has its children packed vertically. It automatically
420
- adjusts the relative positions of children at drawing time.
417
+ VPacker packs its children vertically, automatically adjusting their
418
+ relative positions at draw time.
421
419
"""
422
- def __init__ (self , pad = None , sep = None , width = None , height = None ,
423
- align = "baseline" , mode = "fixed" ,
424
- children = None ):
425
- r"""
426
- Parameters
427
- ----------
428
- pad : float, optional
429
- The boundary padding in points.
430
-
431
- sep : float, optional
432
- The spacing between items in points.
433
-
434
- width, height : float, optional
435
- Width and height of the container box in pixels, calculated if
436
- *None*.
437
-
438
- align : {'top', 'bottom', 'left', 'right', 'center', 'baseline'}
439
- Alignment of boxes.
440
-
441
- mode : {'fixed', 'expand', 'equal'}
442
- The packing mode.
443
-
444
- - 'fixed' packs the given `.Artist`\s tight with *sep* spacing.
445
- - 'expand' uses the maximal available space to distribute the
446
- artists with equal spacing in between.
447
- - 'equal': Each artist an equal fraction of the available space
448
- and is left-aligned (or top-aligned) therein.
449
-
450
- children : list of `.Artist`
451
- The artists to pack.
452
-
453
- Notes
454
- -----
455
- *pad* and *sep* are in points and will be scaled with the renderer
456
- dpi, while *width* and *height* are in in pixels.
457
- """
458
- super ().__init__ (pad , sep , width , height , align , mode , children )
459
420
460
421
def get_extent_offsets (self , renderer ):
461
422
# docstring inherited
@@ -494,46 +455,9 @@ def get_extent_offsets(self, renderer):
494
455
495
456
class HPacker (PackerBase ):
496
457
"""
497
- The HPacker has its children packed horizontally. It automatically
498
- adjusts the relative positions of children at draw time.
458
+ HPacker packs its children horizontally, automatically adjusting their
459
+ relative positions at draw time.
499
460
"""
500
- def __init__ (self , pad = None , sep = None , width = None , height = None ,
501
- align = "baseline" , mode = "fixed" ,
502
- children = None ):
503
- r"""
504
- Parameters
505
- ----------
506
- pad : float, optional
507
- The boundary padding in points.
508
-
509
- sep : float, optional
510
- The spacing between items in points.
511
-
512
- width, height : float, optional
513
- Width and height of the container box in pixels, calculated if
514
- *None*.
515
-
516
- align : {'top', 'bottom', 'left', 'right', 'center', 'baseline'}
517
- Alignment of boxes.
518
-
519
- mode : {'fixed', 'expand', 'equal'}
520
- The packing mode.
521
-
522
- - 'fixed' packs the given `.Artist`\s tight with *sep* spacing.
523
- - 'expand' uses the maximal available space to distribute the
524
- artists with equal spacing in between.
525
- - 'equal': Each artist an equal fraction of the available space
526
- and is left-aligned (or top-aligned) therein.
527
-
528
- children : list of `.Artist`
529
- The artists to pack.
530
-
531
- Notes
532
- -----
533
- *pad* and *sep* are in points and will be scaled with the renderer
534
- dpi, while *width* and *height* are in in pixels.
535
- """
536
- super ().__init__ (pad , sep , width , height , align , mode , children )
537
461
538
462
def get_extent_offsets (self , renderer ):
539
463
# docstring inherited
0 commit comments