Metadata-Version: 2.4
Name: sysplot
Version: 1.0.2
Summary: Centralized plotting utilities for reproducible, publication-quality figures in system theory and control engineering
Author-email: Jax <jax.raffnix@posteo.com>
License-Expression: MIT
Project-URL: homepage, https://jaxraffnix.github.io/sysplot
Project-URL: documentation, https://jaxraffnix.github.io/sysplot
Project-URL: repository, https://github.com/JaxRaffnix/sysplot
Project-URL: bug-tracker, https://github.com/JaxRaffnix/sysplot/issues
Keywords: plotting,control-theory,bode,nyquist,poles-zeros
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: matplotlib>=3.5.0
Requires-Dist: numpy>=1.23.0
Requires-Dist: cycler>=0.11.0
Requires-Dist: seaborn>=0.10.0
Provides-Extra: dev
Requires-Dist: pytest>=9.0.0; extra == "dev"
Requires-Dist: control>=0.10.0; extra == "dev"
Requires-Dist: ruff>=0.15.6; extra == "dev"
Requires-Dist: ty>=0.0.23; extra == "dev"
Requires-Dist: ipykernel>=7.2.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=9.0.0; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints>=3.6.0; extra == "docs"
Requires-Dist: pydata-sphinx-theme>=0.15.0; extra == "docs"
Requires-Dist: sphinx-gallery>=0.20.0; extra == "docs"
Requires-Dist: sphinx-design; extra == "docs"
Requires-Dist: control>=0.10.0; extra == "docs"
Dynamic: license-file

<p align="center">
  <img src="docs/_static/wide.svg" width="400">
</p>

![PyPI](https://img.shields.io/pypi/v/sysplot)
![CI](https://github.com/JaxRaffnix/sysplot/actions/workflows/ci.yaml/badge.svg)
![Docs](https://github.com/JaxRaffnix/sysplot/actions/workflows/docs.yaml/badge.svg)
![Publish](https://github.com/JaxRaffnix/sysplot/actions/workflows/publish.yaml/badge.svg)

# Sysplot

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.

The project documentation is available via GitHub [Pages](https://jaxraffnix.github.io/sysplot).

## Installation

Sysplot is available on PyPI. [Python 3.11](https://www.python.org/downloads/) or higher is required. Install with [uv](https://docs.astral.sh/uv/):

```bash
uv add sysplot
```

Or with pip:

```bash
pip install sysplot
```

## Minimum 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.

![Bode Plot](docs/_auto_examples/images/sphx_glr_minimum_example_001.png)

```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)

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()
```

## Contributing

See [CONTRIBUTING](CONTRIBUTING.md) for dev setup, code requirements, and contribution guidelines.

## License

MIT License – see [LICENSE](LICENSE) for details.

## TODO

- add pytest for gallery examples to CI workflow.
