8000 Fix regression with matplotlib 3.7.0 · python-control/python-control@4c4b3fc · GitHub
[go: up one dir, main page]

Skip to content

Commit 4c4b3fc

Browse files
committed
Fix regression with matplotlib 3.7.0
1 parent f2878d5 commit 4c4b3fc

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

control/freqplot.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,9 +1024,11 @@ def _parse_linestyle(style_name, allow_false=False):
10241024
# Plot the scaled sections of the curve (changing linestyle)
10251025
x_scl = np.ma.masked_where(scale_mask, resp.real)
10261026
y_scl = np.ma.masked_where(scale_mask, resp.imag)
1027-
plt.plot(
1028-
x_scl * (1 + curve_offset), y_scl * (1 + curve_offset),
1029-
primary_style[1], color=c, **kwargs)
1027+
if x_scl.count() >= 1 and y_scl.count() >= 1:
1028+
plt.plot(
1029+
x_scl * (1 + curve_offset),
1030+
y_scl * (1 + curve_offset),
1031+
primary_style[1], color=c, **kwargs)
10301032

10311033
# Plot the primary curve (invisible) for setting arrows
10321034
x, y = resp.real.copy(), resp.imag.copy()
@@ -1044,10 +1046,11 @@ def _parse_linestyle(style_name, allow_false=False):
10441046
# Plot the regular and scaled segments
10451047
plt.plot(
10461048
x_reg, -y_reg, mirror_style[0], color=c, **kwargs)
1047-
plt.plot(
1048-
x_scl * (1 - curve_offset),
1049-
-y_scl * (1 - curve_offset),
1050-
mirror_style[1], color=c, **kwargs)
1049+
if x_scl.count() >= 1 and y_scl.count() >= 1:
1050+
plt.plot(
1051+
x_scl * (1 - curve_offset),
1052+
-y_scl * (1 - curve_offset),
1053+
mirror_style[1], color=c, **kwargs)
10511054

10521055
# Add the arrows (on top of an invisible contour)
10531056
x, y = resp.real.copy(), resp.imag.copy()

0 commit comments

Comments
 (0)
0