@@ -2892,11 +2892,11 @@ def __call__(self, path, mutation_size, linewidth,
2892
2892
path_shrunk = Path (vertices , path .codes )
2893
2893
# call transmute method with squeezed height.
2894
2894
path_mutated , fillable = self .transmute (path_shrunk ,
2895
- linewidth ,
2896
- mutation_size )
2895
+ mutation_size ,
2896
+ linewidth )
2897
2897
if np .iterable (fillable ):
2898
2898
path_list = []
2899
- for p in zip ( path_mutated ) :
2899
+ for p in path_mutated :
2900
2900
# Restore the height
2901
2901
path_list .append (
2902
2902
Path (p .vertices * [1 , aspect_ratio ], p .codes ))
@@ -3565,10 +3565,8 @@ def __str__(self):
3565
3565
3566
3566
@docstring .dedent_interpd
3567
3567
def __init__ (self , xy , width , height ,
3568
- boxstyle = "round" ,
3569
- bbox_transmuter = None ,
3570
- mutation_scale = 1. ,
3571
- mutation_aspect = None ,
3568
+ boxstyle = "round" , bbox_transmuter = None ,
3569
+ mutation_scale = 1 , mutation_aspect = 1 ,
3572
3570
** kwargs ):
3573
3571
"""
3574
3572
Parameters
@@ -3597,7 +3595,7 @@ def __init__(self, xy, width, height,
3597
3595
Scaling factor applied to the attributes of the box style
3598
3596
(e.g. pad or rounding_size).
3599
3597
3600
- mutation_aspect : float, optional
3598
+ mutation_aspect : float, default: 1
3601
3599
The height of the rectangle will be squeezed by this value before
3602
3600
the mutation and the mutated box will be stretched by the inverse
3603
3601
of it. For example, this allows different horizontal and vertical
@@ -3703,7 +3701,8 @@ def set_mutation_aspect(self, aspect):
3703
3701
3704
3702
def get_mutation_aspect (self ):
3705
3703
"""Return the aspect ratio of the bbox mutation."""
3706
- return self ._mutation_aspect
3704
+ return (self ._mutation_aspect if self ._mutation_aspect is not None
3705
+ else 1 ) # backcompat.
3707
3706
3708
3707
def get_boxstyle (self ):
3709
3708
"""Return the boxstyle object."""
@@ -3830,16 +3829,11 @@ def __str__(self):
3830
3829
3831
3830
@docstring .dedent_interpd
3832
3831
@cbook ._delete_parameter ("3.4" , "dpi_cor" )
3833
- def __init__ (self , posA = None , posB = None ,
3834
- path = None ,
3835
- arrowstyle = "simple" ,
3836
- connectionstyle = "arc3" ,
3837
- patchA = None ,
3838
- patchB = None ,
3839
- shrinkA = 2 ,
3840
- shrinkB = 2 ,
3841
- mutation_scale = 1 ,
3842
- mutation_aspect = None ,
3832
+ def __init__ (self , posA = None , posB = None , path = None ,
3833
+ arrowstyle = "simple" , connectionstyle = "arc3" ,
3834
+ patchA = None , patchB = None ,
3835
+ shrinkA = 2 , shrinkB = 2 ,
3836
+ mutation_scale = 1 , mutation_aspect = 1 ,
3843
3837
dpi_cor = 1 ,
3844
3838
** kwargs ):
3845
3839
"""
@@ -4106,7 +4100,8 @@ def set_mutation_aspect(self, aspect):
4106
4100
4107
4101
def get_mutation_aspect (self ):
4108
4102
"""Return the aspect ratio of the bbox mutation."""
4109
- return self ._mutation_aspect
4103
+ return (self ._mutation_aspect if self ._mutation_aspect is not None
4104
+ else 1 ) # backcompat.
4110
4105
4111
4106
def get_path (self ):
4112
4107
"""
0 commit comments