@@ -1060,7 +1060,9 @@ def gen_zero_centered_series(val_min, val_max, period):
1060
1060
'nyquist.max_curve_magnitude' : 20 , # clip large values
1061
1061
'nyquist.max_curve_offset' : 0.02 , # offset of primary/mirror
1062
1062
'nyquist.start_marker' : 'o' , # marker at start of curve
1063
- 'nyquist.start_marker_size' : 4 , # size of the maker
1063
+ 'nyquist.start_marker_size' : 4 , # size of the marker
1064
+ 'nyquist.circle_style' : # style for unit circles
1065
+ {'color' : 'black' , 'linestyle' : 'dashed' , 'linewidth' : 1 }
1064
1066
}
1065
1067
1066
1068
@@ -1504,9 +1506,9 @@ def nyquist_plot(
1504
1506
unit_circle : bool, optional
1505
1507
If ``True``, display the unit circle, to read gain crossover frequency.
1506
1508
mt_circles : array_like, optional
1507
- Draws circles corresponding to the given magnitudes of sensitivity.
1509
+ Draw circles corresponding to the given magnitudes of sensitivity.
1508
1510
ms_circles : array_like, optional
1509
- Draws circles corresponding to the given magnitudes in complementary
1511
+ Draw circles corresponding to the given magnitudes of complementary
1510
1512
sensitivity.
1511
1513
**kwargs : :func:`matplotlib.pyplot.plot` keyword properties, optional
1512
1514
Additional keywords (passed to `matplotlib`)
@@ -1861,38 +1863,49 @@ def _parse_linestyle(style_name, allow_false=False):
1861
1863
1862
1864
# Mark the -1 point
1863
1865
plt .plot ([- 1 ], [0 ], 'r+' )
1864
-
1866
+
1867
+ #
1868
+ # Draw circles for gain crossover and sensitivity functions
1869
+ #
1865
1870
theta = np .linspace (0 , 2 * np .pi , 100 )
1866
1871
cos = np .cos (theta )
1867
1872
sin = np .sin (theta )
1868
1873
label_pos = 15
1869
1874
1875
+ # Display the unit circle, to read gain crossover frequency
1870
1876
if unit_circle :
1871
- plt .plot (cos , sin , color = "black" , linestyle = 'dashed' , linewidth = 1 )
1877
+ plt .plot (cos , sin , ** config . defaults [ 'nyquist.circle_style' ] )
1872
1878
1879
+ # Draw circles for given magnitudes of sensitivity
1873
1880
if ms_circles is not None :
1874
1881
for ms in ms_circles :
1875
1882
pos_x = - 1 + (1 / ms )* cos
1876
1883
pos_y = (1 / ms )* sin
1877
- plt .plot (pos_x , pos_y , color = "black" , linestyle = "dashed" , linewidth = 1 )
1884
+ plt .plot (
1885
+ pos_x , pos_y , ** config .defaults ['nyquist.circle_style' ])
1878
1886
plt .text (pos_x [label_pos ], pos_y [label_pos ], ms )
1879
1887
1888
+ # Draw circles for given magnitudes of complementary sensitivity
1880
1889
if mt_circles is not None :
1881
1890
for mt in mt_circles :
1882
1891
if mt != 1 :
1883
1892
ct = - mt ** 2 / (mt ** 2 - 1 ) # Mt center
1884
1893
rt = mt / (mt ** 2 - 1 ) # Mt radius
1885
1894
pos_x = ct + rt * cos
1886
1895
pos_y = rt * sin
1887
- plt .plot (pos_x , pos_y , color = "black" , linestyle = "dashed" , linewidth = 1 )
1896
+ plt .plot (
1897
+ pos_x , pos_y ,
1898
+ ** config .defaults ['nyquist.circle_style' ])
1888
1899
plt .text (pos_x [label_pos ], pos_y [label_pos ], mt )
1889
1900
else :
1890
1901
_ , _ , ymin , ymax = plt .axis ()
1891
1902
pos_y = np .linspace (ymin , ymax , 100 )
1892
- plt .vlines (- 0.5 , ymin = ymin , ymax = ymax , colors = "black" , linestyles = "dashed" , linewidth = 1 )
1903
+ plt .vlines (
1904
+ - 0.5 , ymin = ymin , ymax = ymax ,
1905
+ ** config .defaults ['nyquist.circle_style' ])
1893
1906
plt .text (- 0.5 , pos_y [label_pos ], 1 )
1894
1907
1895
- # Label the frequencies of the points
1908
+ # Label the frequencies of the points on the Nyquist curve
1896
1909
if label_freq :
1897
1910
ind = slice (None , None , label_freq )
1898
1911
omega_sys = np .imag (splane_contour [np .real (splane_contour ) == 0 ])
0 commit comments