@@ -2454,14 +2454,12 @@ def transmute(self, x0, y0, width, height, mutation_size):
2454
2454
2455
2455
class FancyBboxPatch (Patch ):
2456
2456
"""
2457
- A fancy box around a rectangle with lower left at *xy*=(*x*,
2458
- *y*) with specified width and height.
2459
-
2460
- :class:`FancyBboxPatch` class is similar to :class:`Rectangle`
2461
- class, but it draws a fancy box around the rectangle. The
2462
- transformation of the rectangle box to the fancy box is delegated
2463
- to the :class:`BoxTransmuterBase` and its derived classes.
2457
+ A fancy box around a rectangle with lower left at *xy* = (*x*, *y*)
2458
+ with specified width and height.
2464
2459
2460
+ `.FancyBboxPatch` is similar to `.Rectangle`, but it draws a fancy box
2461
+ around the rectangle. The transformation of the rectangle box to the
2462
+ fancy box is delegated to the `.BoxTransmuterBase` and its derived classes.
2465
2463
"""
2466
2464
2467
2465
_edge_default = True
@@ -2478,25 +2476,42 @@ def __init__(self, xy, width, height,
2478
2476
mutation_aspect = None ,
2479
2477
** kwargs ):
2480
2478
"""
2481
- *xy* = lower left corner
2479
+ Parameters
2480
+ ----------
2481
+ xy : float, float
2482
+ The lower left corner of the box.
2483
+
2484
+ width : float
2485
+ The width of the box.
2482
2486
2483
- *width*, *height*
2487
+ height : float
2488
+ The height of the box.
2484
2489
2485
- *boxstyle* determines what kind of fancy box will be drawn. It
2486
- can be a string of the style name with a comma separated
2487
- attribute, or an instance of :class:`BoxStyle`. Following box
2488
- styles are available.
2490
8000
td>+ boxstyle : str or `matplotlib.patches.BoxStyle`
2491
+ The style of the fancy box. This can either be a `.BoxStyle`
2492
+ instance or a string of the style name and optionally comma
2493
+ seprarated attributes (e.g. "Round, pad=0.2"). This string is
2494
+ passed to `.BoxStyle` to construct a `.BoxStyle` object. See
2495
+ there for a full documentation.
2489
2496
2490
- %(AvailableBoxstyles)s
2497
+ The following box styles are available:
2491
2498
2492
- *mutation_scale* : a value with which attributes of boxstyle
2493
- (e.g., pad) will be scaled. default=1.
2499
+ %(AvailableBoxstyles)s
2494
2500
2495
- *mutation_aspect* : The height of the rectangle will be
2496
- squeezed by this value before the mutation and the mutated
2497
- box will be stretched by the inverse of it. default=None.
2501
+ mutation_scale : float, optional, default: 1
2502
+ Scaling factor applied to the attributes of the box style
2503
+ (e.g. pad or rounding_size).
2504
+
2505
+ mutation_aspect : float, optional
2506
+ The height of the rectangle will be squeezed by this value before
2507
+ the mutation and the mutated box will be stretched by the inverse
2508
+ of it. For example, this allows different horizontal and vertical
2509
+ padding.
2510
+
2511
+ Other Parameters
2512
+ ----------------
2513
+ **kwargs : `.Patch` properties
2498
2514
2499
- Valid kwargs are:
2500
2515
%(Patch)s
2501
2516
"""
2502
2517
@@ -2563,9 +2578,7 @@ def set_mutation_scale(self, scale):
2563
2578
self .stale = True
2564
2579
2565
2580
def get_mutation_scale (self ):
2566
- """
2567
- Return the mutation scale.
2568
- """
2581
+ """Return the mutation scale."""
2569
2582
return self ._mutation_scale
2570
2583
2571
2584
def set_mutation_aspect (self , aspect ):
@@ -2580,20 +2593,15 @@ def set_mutation_aspect(self, aspect):
2580
2593
self .stale = True
2581
2594
2582
2595
def get_mutation_aspect (self ):
2583
- """
2584
- Return the aspect ratio of the bbox mutation.
2585
- """
2596
+ """Return the aspect ratio of the bbox mutation."""
2586
2597
return self ._mutation_aspect
2587
2598
2588
2599
def get_boxstyle (self ):
2589
- "Return the boxstyle object"
2600
+ """ Return the boxstyle object."" "
2590
2601
return self ._bbox_transmuter
2591
2602
2592
2603
def get_path (self ):
2593
- """
2594
- Return the mutated path of the rectangle
2595
- """
2596
-
2604
+ """Return the mutated path of the rectangle."""
2597
2605
_path = self .get_boxstyle ()(self ._x , self ._y ,
2598
2606
self ._width , self ._height ,
2599
2607
self .get_mutation_scale (),
@@ -2603,19 +2611,19 @@ def get_path(self):
2603
2611
# Following methods are borrowed from the Rectangle class.
2604
2612
2605
2613
def get_x (self ):
2606
- "Return the left coord of the rectangle"
2614
+ """ Return the left coord of the rectangle."" "
2607
2615
return self ._x
2608
2616
2609
2617
def get_y (self ):
2610
- "Return the bottom coord of the rectangle"
2618
+ """ Return the bottom coord of the rectangle."" "
2611
2619
return self ._y
2612
2620
2613
2621
def get_width (self ):
2614
- "Return the width of the rectangle"
2622
+ """ Return the width of the rectangle."" "
2615
2623
return self ._width
2616
2624
2617
2625
def get_height (self ):
2618
- "Return the height of the rectangle"
2626
+ """ Return the height of the rectangle."" "
2619
2627
return self ._height
2620
2628
2621
2629
def set_x (self , x ):
@@ -2664,9 +2672,19 @@ def set_height(self, h):
2664
2672
2665
2673
def set_bounds (self , * args ):
2666
2674
"""
2667
- Set the bounds of the rectangle: l,b,w,h
2675
+ Set the bounds of the rectangle.
2668
2676
2669
- ACCEPTS: (left, bottom, width, height)
2677
+ Call signatures::
2678
+
2679
+ set_bounds(left, bottom, width, height)
2680
+ set_bounds((left, bottom, width, height))
2681
+
2682
+ Parameters
2683
+ ----------
2684
+ left, bottom : float
2685
+ The coordinates of the bottom left corner of the rectangle.
2686
+ width, height : float
2687
+ The width/height of the rectangle.
2670
2688
"""
2671
2689
if len (args ) == 1 :
2672
2690
l , b , w , h = args [0 ]
@@ -2679,6 +2697,7 @@ def set_bounds(self, *args):
2679
2697
self .stale = True
2680
2698
2681
2699
def get_bbox (self ):
2700
+ """Return the `.Bbox` of the rectangle."""
2682
2701
return transforms .Bbox .from_bounds (self ._x , self ._y ,
2683
2702
self ._width , self ._height )
2684
2703
0 commit comments