mplbezier
This module allows you to draw Bezier curves interactively in matplotlib and load them again afterwards. Install it by cloning the git repository, navigating into the repository root directory and typing into the console:
pip install .
Simply import Bezier from mplbezier and create a new Bezier object, which you pass both the Axis and a filename
of a pickle file to store the anchor point data. Using Bezier.enable, you enable the interactive drawing mode. In
order to use the interactive drawing mode, you need to be inside an interactive matplotlib backend, such as qtagg.
If you are using this module from a Jupyter notebook, switch to interactive mode using magic commands such as
%matplotlib Qt at the top of the cell.
import matplotlib.pyplot as plt
from mplbezier import Bezier
fig, ax = plt.subplots()
b = Bezier(ax, 'my_curve.pkl')
b.enable()
plt.show()
By clicking with the left mouse button inside the plot, you will generate a new anchor point. By clicking on an anchor point, you can reveal the handles with which you can define the position of the control points. By dragging a point, you can move it on the axis. By right clicking a point, you can remove it from the Bezier curve. If the point lies between two other points, the curve will automatically connect the two surrounding points with each other. Moreover, "ctrl+z" is supported to undo your last action.
Once you are satisfied with your curve, you can remove or comment out the line b.enable(). This will remove the
anchor points from the curve, thereby giving you the final plot.
The curve can be initialized with three keyword arguments:
csets the color (default 'black')lwsets the linewidth (default 1)lssets the linestyle (default ('-')
Metadata
Release files for mplbezier 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mplbezier-0.1.0.tar.gz | 3.6 kB | Without provenance | Details for mplbezier-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mplbezier-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for mplbezier-0.1.0-py3-none-any.whl |
Total release size: 7.3 kB
Release files / mplbezier-0.1.0.tar.gz
| Download URL | mplbezier-0.1.0.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d8d6305da56653fb266544c19d6aebc9e486fe5e6f659bd54a150d77490696d4
|
|
BLAKE2b-256 checksum How to use checksums |
e858bcd18f2c21846adc7b8161d88d4305f8be4710b9cbd8d8774b9b912cbf87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.0
|
Release files / mplbezier-0.1.0-py3-none-any.whl
| Download URL | mplbezier-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d137d070b98a560de50e4eb50f09f276e7c1c5fdc8eb86a5b8c7ffcffa1327a1
|
|
BLAKE2b-256 checksum How to use checksums |
df135a03cf2b7daeae88dc53d3403441d356f0584fff03a43e18320d0727f7f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.0
|
Security for mplbezier 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.