@@ -1886,9 +1886,10 @@ def _parse_linestyle(style_name, allow_false=False):
18861886 kwargs , None , 'upper right' )
18871887
18881888 # Create a list of lines for the output
1889- out = np .empty (len (nyquist_responses ), dtype = object )
1890- for i in range (out .shape [0 ]):
1891- out [i ] = [] # unique list in each element
1889+ out = np .empty ((len (nyquist_responses ), 4 ), dtype = object )
1890+ for i in range (len (nyquist_responses )):
1891+ for j in range (4 ):
1892+ out [i , j ] = [] # unique list in each element
18921893
18931894 for idx , response in enumerate (nyquist_responses ):
18941895 resp = response .response
@@ -1938,7 +1939,7 @@ def _parse_linestyle(style_name, allow_false=False):
19381939 p = ax .plot (
19391940 x_reg , y_reg , primary_style [0 ], color = color , label = label , ** kwargs )
19401941 c = p [0 ].get_color ()
1941- out [idx ] += p
1942+ out [idx , 0 ] += p
19421943
19431944 # Figure out how much to offset the curve: the offset goes from
19441945 # zero at the start of the scaled section to max_curve_offset as
@@ -1950,12 +1951,12 @@ def _parse_linestyle(style_name, allow_false=False):
19501951 x_scl = np .ma .masked_where (scale_mask , resp .real )
19511952 y_scl = np .ma .masked_where (scale_mask , resp .imag )
19521953 if x_scl .count () >= 1 and y_scl .count () >= 1 :
1953- out [idx ] += ax .plot (
1954+ out [idx , 1 ] += ax .plot (
19541955 x_scl * (1 + curve_offset ),
19551956 y_scl * (1 + curve_offset ),
19561957 primary_style [1 ], color = c , ** kwargs )
19571958 else :
1958- out [idx ] += [None ]
1959+ out [idx , 1 ] += [None ]
19591960
19601961 # Plot the primary curve (invisible) for setting arrows
19611962 x , y = resp .real .copy (), resp .imag .copy ()
@@ -1970,15 +1971,15 @@ def _parse_linestyle(style_name, allow_false=False):
19701971 # Plot the mirror image
19711972 if mirror_style is not False :
19721973 # Plot the regular and scaled segments
1973- out [idx ] += ax .plot (
1974+ out [idx , 2 ] += ax .plot (
19741975 x_reg , - y_reg , mirror_style [0 ], color = c , ** kwargs )
19751976 if x_scl .count () >= 1 and y_scl .count () >= 1 :
1976- out [idx ] += ax .plot (
1977+ out [idx , 3 ] += ax .plot (
19771978 x_scl * (1 - curve_offset ),
19781979 - y_scl * (1 - curve_offset ),
19791980 mirror_style [1 ], color = c , ** kwargs )
19801981 else :
1981- out [idx ] += [None ]
1982+ out [idx , 3 ] += [None ]
19821983
19831984 # Add the arrows (on top of an invisible contour)
19841985 x , y = resp .real .copy (), resp .imag .copy ()
@@ -1988,12 +1989,15 @@ def _parse_linestyle(style_name, allow_false=False):
19881989 _add_arrows_to_line2D (
19891990 ax , p [0 ], arrow_pos , arrowstyle = arrow_style , dir = - 1 )
19901991 else :
1991- out [idx ] += [None , None ]
1992+ out [idx , 2 ] += [None ]
1993+ out [idx , 3 ] += [None ]
19921994
19931995 # Mark the start of the curve
19941996 if start_marker :
1995- ax .plot (resp [0 ].real , resp [0 ].imag , start_marker ,
1996- color = c , markersize = start_marker_size )
1997+ segment = 0 if 0 in rescale_idx else 1 # regular vs scaled
1998+ out [idx , segment ] += ax .plot (
1999+ resp [0 ].real , resp [0 ].imag , start_marker ,
2000+ color = c , markersize = start_marker_size )
19972001
19982002 # Mark the -1 point
19992003 ax .plot ([- 1 ], [0 ], 'r+' )
0 commit comments