@@ -626,19 +626,19 @@ def _angles_lengths(self, U, V, eps=1):
626
626
627
627
def _make_verts (self , U , V , angles ):
628
628
uv = (U + V * 1j )
629
- str_angles = isinstance (angles , six .string_types )
630
- if str_angles and ( angles == 'xy' and self .scale_units == 'xy' ) :
629
+ str_angles = angles if isinstance (angles , six .string_types ) else ''
630
+ if str_angles == 'xy' and self .scale_units == 'xy' :
631
631
# Here eps is 1 so that if we get U, V by diffing
632
632
# the X, Y arrays, the vectors will connect the
633
633
# points, regardless of the axis scaling (including log).
634
634
angles , lengths = self ._angles_lengths (U , V , eps = 1 )
635
- elif str_angles and ( angles == 'xy' or self .scale_units == 'xy' ) :
635
+ elif str_angles == 'xy' or self .scale_units == 'xy' :
636
636
# Calculate eps based on the extents of the plot
637
637
# so that we don't end up with roundoff error from
638
638
# adding a small number to a large.
639
639
eps = np .abs (self .ax .dataLim .extents ).max () * 0.001
640
640
angles , lengths = self ._angles_lengths (U , V , eps = eps )
641
- if self .scale_units == 'xy' :
641
+ if str_angles and self .scale_units == 'xy' :
642
642
a = lengths
643
643
else :
644
644
a = np .abs (uv )
@@ -665,9 +665,9 @@ def _make_verts(self, U, V, angles):
665
665
self .scale = scale * widthu_per_lenu
666
666
length = a * (widthu_per_lenu / (self .scale * self .width ))
667
667
X , Y = self ._h_arrows (length )
668
- if str_angles and ( angles == 'xy' ) :
668
+ if str_angles == 'xy' :
669
669
theta = angles
670
- elif str_angles and ( angles == 'uv' ) :
670
+ elif str_angles == 'uv' :
671
671
theta = np .angle (uv )
672
672
else :
673
673
theta = ma .masked_invalid (np .deg2rad (angles )).filled (0 )
0 commit comments