Metadata-Version: 2.1
Name: blockplotlib
Version: 2023.1.1
Summary: Matplotlib-based library for the creation of block diagrams
Author: Marcus Riesmeier
Author-email: gluehen-sierren-0c@icloud.com
License: BSD 3-Clause License
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: matplotlib
Requires-Dist: Shapely

[![name](https://img.shields.io/pypi/v/blockplotlib?label=pypi%20package)](https://pypi.org/project/blockplotlib)
[![name](https://img.shields.io/pypi/dm/blockplotlib)](https://pypi.org/project/blockplotlib)

# Blockplotlib

Matplotlib-based library for the creation of block diagrams.
Besides this core functionality, blockplotlib provides a workflow
to include all kinds of matplotlib figures with the correct font size
into latex documents. While latex is also often used to render text
inside figures/block diagrams, blockplotlib (as matplotlib)
depends not on latex.

The functionality of the library is limited to the features
demonstrated in the examples but can be extended quite easily.

## Examples

How to draw a simple control loop is illustrated with the
example `blockplotlib/examples/control_loop_one_dof.py`.

![control_loop_one_dof](https://github.com/riemarc/blockplotlib/assets/18379817/8036afdd-85ff-449b-8a48-255cda09dcb2)
[control_loop_one_dof.pdf](https://github.com/riemarc/blockplotlib/files/11445397/control_loop_one_dof.pdf)


A more complex example is the block diagram of the
so-called hyperbolic observer canonical form:
`blockplotlib/examples/hyperbolic_ocf.py`

![hyperbolic_ocf](https://github.com/riemarc/blockplotlib/assets/18379817/db997067-0890-458f-a1b0-7ff48dfbcbeb)
[hyperbolic_ocf.pdf](https://github.com/riemarc/blockplotlib/files/11445461/hyperbolic_ocf.pdf)

The inclusion of matplotlib figures with the correct
font size into a latex document can be adapted
from the example under `blockplotlib/examples/tex_article`.
It basically relies on two measurements of the height of a string.
One measurement is performed in the latex preamble and the
other one in the respective matplotlib figure using
a blockplotlib function.

More examples can be found under `blockplotlib/examples/`.

## Installation

One way to use blockplotlib is to install it via
pip (`pip install blockplotlib`).
Another way to use it is to copy the file `blockplotlib.py` in the folder
of the Python script from which it is to be imported.
