Skip to content

Matplotlib 3.7 breaks nyquist_plot() #864

Description

@henklaak
>>> nyquist(tf([1],[1,1]))


Traceback (most recent call last):
  File "/home/henklaak/Software/python-control/examples/secord-matlab.py", line 8, in <module>
    nyquist(tf([1],[1,1]))
  File "/home/henklaak/Software/python-control/control/matlab/wrappers.py", line 109, in nyquist
    _, contour = nyquist_plot(syslist, omega, *args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/henklaak/Software/python-control/control/freqplot.py", line 1027, in nyquist_plot
    plt.plot(
  File "/home/henklaak/anaconda3/envs/bla/lib/python3.11/site-packages/matplotlib/pyplot.py", line 2785, in plot
    return gca().plot(
           ^^^^^^^^^^^
  File "/home/henklaak/anaconda3/envs/bla/lib/python3.11/site-packages/matplotlib/axes/_axes.py", line 1690, in plot
    self.add_line(line)
  File "/home/henklaak/anaconda3/envs/bla/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 2304, in add_line
    self._update_line_limits(line)
  File "/home/henklaak/anaconda3/envs/bla/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 2327, in _update_line_limits
    path = line.get_path()
           ^^^^^^^^^^^^^^^
  File "/home/henklaak/anaconda3/envs/bla/lib/python3.11/site-packages/matplotlib/lines.py", line 1029, in get_path
    self.recache()
  File "/home/henklaak/anaconda3/envs/bla/lib/python3.11/site-packages/matplotlib/lines.py", line 681, in recache
    self._x_filled[nanmask] = np.interp(
                              ^^^^^^^^^^
  File "<__array_function__ internals>", line 200, in interp
  File "/home/henklaak/anaconda3/envs/bla/lib/python3.11/site-packages/numpy/lib/function_base.py", line 1595, in interp
    return interp_func(x, xp, fp, left, right)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: array of sample points is empty

Activity

  1. changed the title [-]Matplotlib 3.7 breaks python-control[/-] [+]Matplotlib 3.7 breaks plotting[/+] on Feb 17, 2023
  2. changed the title [-]Matplotlib 3.7 breaks plotting[/-] [+]Matplotlib 3.7 breaks nyquist_plot[/+] on Feb 17, 2023
  3. changed the title [-]Matplotlib 3.7 breaks nyquist_plot[/-] [+]Matplotlib 3.7 breaks nyquist_plot()[/+] on Feb 17, 2023
  4. added a commit that references this issue on Feb 18, 2023
  5. murrayrm commented on Feb 18, 2023

    @murrayrm
    Member

    Fixed in #863

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions