@@ -2437,14 +2437,12 @@ def transmute(self, x0, y0, width, height, mutation_size):
2437
2437
2438
2438
class FancyBboxPatch (Patch ):
2439
2439
"""
2440
- A fancy box around a rectangle with lower left at *xy*=(*x*,
2441
- *y*) with specified width and height.
2442
-
2443
- :class:`FancyBboxPatch` class is similar to :class:`Rectangle`
2444
- class, but it draws a fancy box around the rectangle. The
2445
- transformation of the rectangle box to the fancy box is delegated
2446
- to the :class:`BoxTransmuterBase` and its derived classes.
2440
+ A fancy box around a rectangle with lower left at *xy* = (*x*, *y*)
2441
+ with specified width and height.
2447
2442
2443
+ `.FancyBboxPatch` is similar to `.Rectangle`, but it draws a fancy box
2444
+ around the rectangle. The transformation of the rectangle box to the
2445
+ fancy box is delegated to the `.BoxTransmuterBase` and its derived classes.
2448
2446
"""
2449
2447
2450
2448
_edge_default = True
@@ -2461,25 +2459,42 @@ def __init__(self, xy, width, height,
2461
2459
mutation_aspect = None ,
2462
2460
** kwargs ):
2463
2461
"""
2464
- *xy* = lower left corner
2462
+ Parameters
2463
+ ----------
2464
+ xy : float, float
2465
+ The lower left corner of the box.
2466
+
2467
+ width : float
2468
+ The width of the box.
2465
2469
2466
- *width*, *height*
2470
+ height : float
2471
+ The height of the box.
2467
2472
2468
- *boxstyle* determines what kind of fancy box will be drawn. It
2469
- can be a string of the style name with a comma separated
2470
- attribute, or an instance of :class:`BoxStyle`. Following box
2471
- styles are available.
2473
+ boxstyle : str or `matplotlib.patches.BoxStyle`
2474
+ The style of the fancy box. This can either be a `.BoxStyle`
2475
+ instance or a string of the style name and optionally comma
2476
+ seprarated attributes (e.g. "Round, pad=0.2"). This string is
2477
+ passed to `.BoxStyle` to construct a `.BoxStyle` object. See
2478
+ there for a full documentation.
2472
2479
2473
- %(AvailableBoxstyles)s
2480
+ The following box styles are available:
2474
2481
2475
- *mutation_scale* : a value with which attributes of boxstyle
2476
- (e.g., pad) will be scaled. default=1.
2482
+ %(AvailableBoxstyles)s
2477
2483
2478
- *mutation_aspect* : The height of the rectangle will be
2479
- squeezed by this value before the mutation and the mutated
2480
- box will be stretched by the inverse of it. default=None.
2484
+ mutation_scale : float, optional, default: 1
2485
+ Scaling factor applied to the attributes of the box style
2486
+ (e.g. pad or rounding_size).
2487
+
2488
+ mutation_aspect : float, optional
2489
+ The height of the rectangle will be squeezed by this value before
2490
+ the mutation and the mutated box will be stretched by the inverse
2491
+ of it. For example, this allows different horizontal and vertical
2492
+ padding.
2493
+
2494
+ Other Parameters
2495
+ ----------------
2496
+ **kwargs : `.Patch` properties
2481
2497
2482
- Valid kwargs are:
2483
2498
%(Patch)s
2484
2499
"""
2485
2500
@@ -2546,9 +2561,7 @@ def set_mutation_scale(self, scale):
2546
2561
self .stale = True
2547
2562
2548
2563
def get_mutation_scale (self ):
2549
- """
2550
- Return the mutation scale.
2551
- """
2564
+ """Return the mutation scale."""
2552
2565
return self ._mutation_scale
2553
2566
2554
2567
def set_mutation_aspect (self , aspect ):
@@ -2563,20 +2576,15 @@ def set_mutation_aspect(self, aspect):
2563
2576
self .stale = True
2564
2577
2565
2578
def get_mutation_aspect (self ):
2566
- """
2567
- Return the aspect ratio of the bbox mutation.
2568
- """
2579
+ """Return the aspect ratio of the bbox mutation."""
2569
2580
return self ._mutation_aspect
2570
2581
2571
2582
def get_boxstyle (self ):
2572
- "Return the boxstyle object"
2583
+ """ Return the boxstyle object."" "
2573
2584
return self ._bbox_transmuter
2574
2585
2575
2586
def get_path (self ):
2576
- """
2577
- Return the mutated path of the rectangle
2578
- """
2579
-
2587
+ """Return the mutated path of the rectangle."""
2580
2588
_path = self .get_boxstyle ()(self ._x , self ._y ,
2581
2589
self ._width , self ._height ,
2582
2590
self .get_mutation_scale (),
@@ -2586,19 +2594,19 @@ def get_path(self):
2586
2594
# Following methods are borrowed from the Rectangle class.
2587
2595
2588
2596
def get_x (self ):
2589
- "Return the left coord of the rectangle"
2597
+ """ Return the left coord of the rectangle."" "
2590
2598
return self ._x
2591
2599
2592
2600
def get_y (self ):
2593
- "Return the bottom coord of the rectangle"
2601
+ """ Return the bottom coord of the rectangle."" "
2594
2602
return self ._y
2595
2603
2596
2604
def get_width (self ):
2597
- "Return the width of the rectangle"
2605
+ """ Return the width of the rectangle."" "
2598
2606
return self ._width
2599
2607
2600
2608
def get_height (self ):
2601
- "Return the height of the rectangle"
2609
+ """ Return the height of the rectangle."" "
2602
2610
return self ._height
2603
2611
2604
2612
def set_x (self , x ):
@@ -2647,9 +2655,19 @@ def set_height(self, h):
2647
2655
2648
2656
def set_bounds (self , * args ):
2649
2657
"""
2650
- Set the bounds of the rectangle: l,b,w,h
2658
+ Set the bounds of the rectangle.
2651
2659
2652
- ACCEPTS: (left, bottom, width, height)
2660
+ Call signatures::
2661
+
2662
+ set_bounds(left, bottom, width, height)
2663
+ set_bounds((left, bottom, width, height))
2664
+
2665
+ Parameters
2666
+ ----------
2667
+ left, bottom : float
2668
+ The coordinates of the bottom left corner of the rectangle.
2669
+ width, height : float
2670
+ The width/height of the rectangle.
2653
2671
"""
2654
2672
if len (args ) == 1 :
2655
2673
l , b , w , h = args [0 ]
@@ -2662,6 +2680,7 @@ def set_bounds(self, *args):
2662
2680
self .stale = True
2663
2681
2664
2682
def get_bbox (self ):
2683
+ """Return the `.Bbox` of the rectangle."""
2665
2684
return transforms .Bbox .from_bounds (self ._x , self ._y ,
2666
2685
self ._width , self ._height )
2667
2686
0 commit comments