.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_auto_examples/minimum_example.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_minimum_example.py: Minimum Example ===================================== Demonstrates a short example of the core functionality of the sysplot module. * a Bode plot consisting of two subplots * phase unwrapped in multiples of :math:`2\pi` * phase tick labels displayed as fractional multiples of :math:`\frac{\pi}{2}` * magnitude displayed in dB * logarithmic frequency axis * minor ticks at every decade of the frequency axis * consistent figure styling based on a configurable seaborn-derived theme .. GENERATED FROM PYTHON SOURCE LINES 14-32 .. image-sg:: /_auto_examples/images/sphx_glr_minimum_example_001.png :alt: Bode Plot, Phase Plot :srcset: /_auto_examples/images/sphx_glr_minimum_example_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() # apply sysplot style # Generate frequency response omega = np.logspace(-2, 2, 300) system = ctrl.tf([6.25], [1, 3, 6.25]) mag, phase, _ = ctrl.frequency_response(system, omega) fig, axes = ssp.plot_bode(mag, phase, omega) # ** sysplot is used here ** axes[0].set(xlabel="rad/s", ylabel="dB", title="Bode Plot") axes[1].set(xlabel="rad/s", ylabel="rad/s", title="Phase Plot") plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.007 seconds) .. _sphx_glr_download__auto_examples_minimum_example.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: minimum_example.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: minimum_example.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: minimum_example.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_