Sysplot documentation#
Sysplot provides centralized plotting utilities for reproducible, publication-quality figures in system theory and control engineering.
It extends Matplotlib with consistent figure styling, configuration management, specialized helpers for annotating and improving visual clarity, and high-level plotting functions for Bode plots, Nyquist diagrams, and pole-zero maps.
Example#
After you defined the magnitude, phase and frequency data for your system, a single call to
sysplot.plot_bode() is all you need to generate a Bode plot. This will include a custom
seaborn theme, magnitude in dB, phase unwrapped in multiples of \(2\pi\), phase tick labels in
fractional multiples of \(\frac{\pi}{2}\), and a logarithmic frequency axis with minor decade ticks included automatically.
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()
Contents#
Indices and Tables#
Source code and issue tracker are hosted on GitHub: JaxRaffnix/sysplot.