@@ -1885,6 +1885,11 @@ def _parse_linestyle(style_name, allow_false=False):
1885
1885
legend_loc , _ , show_legend = _process_legend_keywords (
1886
1886
kwargs , None , 'upper right' )
1887
1887
1888
+ # Figure out where the blended curve should start
1889
+ if blend_fraction < 0 or blend_fraction > 1 :
1890
+ raise ValueError ("blend_fraction must be between 0 and 1" )
1891
+ blend_curve_start = (1 - blend_fraction ) * max_curve_magnitude
1892
+
1888
1893
# Create a list of lines for the output
1889
1894
out = np .empty ((len (nyquist_responses ), 4 ), dtype = object )
1890
1895
for i in range (len (nyquist_responses )):
@@ -1899,9 +1904,6 @@ def _parse_linestyle(style_name, allow_false=False):
1899
1904
splane_contour = np .log (response .contour ) / response .dt
1900
1905
1901
1906
# Find the different portions of the curve (with scaled pts marked)
1902
- if blend_fraction < 0 or blend_fraction > 1 :
1903
- raise ValueError ("blend_fraction must be between 0 and 1" )
1904
- blend_curve_start = (1 - blend_fraction ) * max_curve_magnitude
1905
1907
reg_mask = np .logical_or (
1906
1908
np .abs (resp ) > blend_curve_start ,
1907
1909
np .logical_not (np .isclose (splane_contour .real , 0 )))
@@ -1918,8 +1920,7 @@ def _parse_linestyle(style_name, allow_false=False):
1918
1920
abs_subset = np .abs (subset )
1919
1921
unit_vectors = subset / abs_subset # Preserve phase/direction
1920
1922
1921
- if blend_curve_start is None or \
1922
- blend_curve_start == max_curve_magnitude :
1923
+ if blend_curve_start == max_curve_magnitude :
1923
1924
# Clip at max_curve_magnitude
1924
1925
resp [rescale_idx ] = max_curve_magnitude * unit_vectors
1925
1926
else :
0 commit comments