@@ -626,19 +626,19 @@ def _angles_lengths(self, U, V, eps=1):
626626
627627 def _make_verts (self , U , V , angles ):
628628 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' :
631631 # Here eps is 1 so that if we get U, V by diffing
632632 # the X, Y arrays, the vectors will connect the
633633 # points, regardless of the axis scaling (including log).
634634 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' :
636636 # Calculate eps based on the extents of the plot
637637 # so that we don't end up with roundoff error from
638638 # adding a small number to a large.
639639 eps = np .abs (self .ax .dataLim .extents ).max () * 0.001
640640 angles , lengths = self ._angles_lengths (U , V , eps = eps )
641- if self .scale_units == 'xy' :
641+ if str_angles and self .scale_units == 'xy' :
642642 a = lengths
643643 else :
644644 a = np .abs (uv )
@@ -665,9 +665,9 @@ def _make_verts(self, U, V, angles):
665665 self .scale = scale * widthu_per_lenu
666666 length = a * (widthu_per_lenu / (self .scale * self .width ))
667667 X , Y = self ._h_arrows (length )
668- if str_angles and ( angles == 'xy' ) :
668+ if str_angles == 'xy' :
669669 theta = angles
670- elif str_angles and ( angles == 'uv' ) :
670+ elif str_angles == 'uv' :
671671 theta = np .angle (uv )
672672 else :
673673 theta = ma .masked_invalid (np .deg2rad (angles )).filled (0 )
0 commit comments