.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_auto_examples/plot_nyquist.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr__auto_examples_plot_nyquist.py: Plot Nyquist ===================================== :func:`sysplot.plot_nyquist` draws the Nyquist diagram of a frequency response in the complex plane. A directional arrow marks the direction of increasing frequency. The complex conjugate (mirror) curve is shown at reduced opacity, controlled by ``alpha``. The arrow position along the curve arc length is set by ``arrow_position``. .. GENERATED FROM PYTHON SOURCE LINES 10-39 .. image-sg:: /_auto_examples/images/sphx_glr_plot_nyquist_001.png :alt: mirror=True (default), mirror=False, arrow_position=0.8 :srcset: /_auto_examples/images/sphx_glr_plot_nyquist_001.png :class: sphx-glr-single-img .. code-block:: Python import numpy as np import matplotlib.pyplot as plt import control as ctrl import sysplot as ssp ssp.apply_config() system = ctrl.tf([6.25], [1, 3, 6.25]) omega = np.logspace(-2, 2, 1000) mag, phase, _ = ctrl.frequency_response(system, omega) real = mag * np.cos(phase) imag = mag * np.sin(phase) fig, axes = plt.subplots(1, 3, figsize=ssp.get_figsize(ncols=3)) # Default: mirror shown at half opacity, arrow at 33 % arc length ssp.plot_nyquist(real, imag, ax=axes[0]) axes[0].set(title="mirror=True (default)", xlabel=r"Re[$H$]", ylabel=r"Im[$H$]") # No mirror curve ssp.plot_nyquist(real, imag, ax=axes[1], mirror=False) axes[1].set(title="mirror=False", xlabel=r"Re[$H$]") # Arrow placed later along the curve ssp.plot_nyquist(real, imag, ax=axes[2], arrow_position=0.8) axes[2].set(title="arrow_position=0.8", xlabel=r"Re[$H$]") plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.605 seconds) .. _sphx_glr_download__auto_examples_plot_nyquist.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_nyquist.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_nyquist.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_nyquist.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_