[![PyPI version](https://badge.fury.io/py/mpltoolbox.svg)](https://pypi.org/project/mpltoolbox)
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/mpltoolbox/badges/version.svg)](https://anaconda.org/conda-forge/mpltoolbox)
[![Documentation Status](https://readthedocs.org/projects/mpltoolbox/badge/?version=latest)](https://mpltoolbox.readthedocs.io/en/latest/?badge=latest)
[![License: BSD 3-Clause](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](LICENSE)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/scipp/mpltoolbox/HEAD?labpath=docs%2Fdemo.ipynb)
# mpltoolbox
Mpltoolbox aims to provide some basic tools (that other libraries such as bokeh or plotly support) for drawing points, lines, rectangles, polygons on Matplotlib figures.
There are many interactive examples in the Matplotlib documentation pages,
but the code snippets are often long and potentially not straightforward to maintain.
With `mpltoolbox`, activating these tools should (hopefully) just be a one-liner.
## Documentation
The documentation for `mpltoolbox` can be found at https://mpltoolbox.readthedocs.io.
## Installation
```sh
pip install mpltoolbox
```
## Examples
```Py
import matplotlib.pyplot as plt
import mpltoolbox as tbx
%matplotlib widget
```
### Points
```Py
fig, ax = plt.subplots()
ax.set_xlim(0, 100)
ax.set_ylim(0, 100)
points = tbx.Points(ax=ax)
```
![points](https://mpltoolbox.readthedocs.io/en/latest/_images/points_4_0.png)
### Lines
```Py
fig, ax = plt.subplots()
ax.set_xlim(0, 100)
ax.set_ylim(0, 100)
lines = tbx.Lines(ax=ax, n=2)
```
![lines](https://mpltoolbox.readthedocs.io/en/latest/_images/lines_4_0.png)
### Rectangles
```Py
fig, ax = plt.subplots()
ax.set_xlim(0, 100)
ax.set_ylim(0, 100)
rectangles = tbx.Rectangles(ax=ax)
```
![rects](https://mpltoolbox.readthedocs.io/en/latest/_images/rectangles_4_0.png)
### Ellipses
```Py
fig, ax = plt.subplots()
ax.set_xlim(0, 100)
ax.set_ylim(0, 100)
ellipses = tbx.Ellipses(ax=ax)
```
![ellipses](https://mpltoolbox.readthedocs.io/en/latest/_images/ellipses_4_0.png)
Raw data
{
"_id": null,
"home_page": "https://github.com/scipp/mpltoolbox",
"name": "mpltoolbox",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": null,
"author": "Neil Vaytet",
"author_email": "neil.vaytet@esss.se",
"download_url": "https://files.pythonhosted.org/packages/3f/5e/c3afae2ca5850566f712d8f6da5c01d84fa76514fdbc3d9bcb80030c21e5/mpltoolbox-24.5.1.tar.gz",
"platform": null,
"description": "[![PyPI version](https://badge.fury.io/py/mpltoolbox.svg)](https://pypi.org/project/mpltoolbox)\n[![Anaconda-Server Badge](https://anaconda.org/conda-forge/mpltoolbox/badges/version.svg)](https://anaconda.org/conda-forge/mpltoolbox)\n[![Documentation Status](https://readthedocs.org/projects/mpltoolbox/badge/?version=latest)](https://mpltoolbox.readthedocs.io/en/latest/?badge=latest)\n[![License: BSD 3-Clause](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](LICENSE)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/scipp/mpltoolbox/HEAD?labpath=docs%2Fdemo.ipynb)\n\n# mpltoolbox\n\nMpltoolbox aims to provide some basic tools (that other libraries such as bokeh or plotly support) for drawing points, lines, rectangles, polygons on Matplotlib figures.\n\nThere are many interactive examples in the Matplotlib documentation pages,\nbut the code snippets are often long and potentially not straightforward to maintain.\n\nWith `mpltoolbox`, activating these tools should (hopefully) just be a one-liner.\n\n## Documentation\n\nThe documentation for `mpltoolbox` can be found at https://mpltoolbox.readthedocs.io.\n\n## Installation\n\n```sh\npip install mpltoolbox\n```\n\n## Examples\n\n```Py\nimport matplotlib.pyplot as plt\nimport mpltoolbox as tbx\n%matplotlib widget\n```\n\n### Points\n\n```Py\nfig, ax = plt.subplots()\nax.set_xlim(0, 100)\nax.set_ylim(0, 100)\n\npoints = tbx.Points(ax=ax)\n```\n\n![points](https://mpltoolbox.readthedocs.io/en/latest/_images/points_4_0.png)\n\n\n### Lines\n\n```Py\nfig, ax = plt.subplots()\nax.set_xlim(0, 100)\nax.set_ylim(0, 100)\n\nlines = tbx.Lines(ax=ax, n=2)\n```\n\n![lines](https://mpltoolbox.readthedocs.io/en/latest/_images/lines_4_0.png)\n\n### Rectangles\n\n```Py\nfig, ax = plt.subplots()\nax.set_xlim(0, 100)\nax.set_ylim(0, 100)\n\nrectangles = tbx.Rectangles(ax=ax)\n```\n\n![rects](https://mpltoolbox.readthedocs.io/en/latest/_images/rectangles_4_0.png)\n\n### Ellipses\n\n```Py\nfig, ax = plt.subplots()\nax.set_xlim(0, 100)\nax.set_ylim(0, 100)\n\nellipses = tbx.Ellipses(ax=ax)\n```\n\n![ellipses](https://mpltoolbox.readthedocs.io/en/latest/_images/ellipses_4_0.png)\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "Interactive tools for matplotlib",
"version": "24.5.1",
"project_urls": {
"Bug Tracker": "https://github.com/scipp/mpltoolbox/issues",
"Homepage": "https://github.com/scipp/mpltoolbox"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "656044a44b026fb540ef03c3ec26d17452993d882df918b164aab4254c6844a7",
"md5": "5144c2280ea7dbaa4038f71828bece95",
"sha256": "9c4b96d6fd8ef1f1fc21e543feef35fb0f700b87942d4314e4b755cada830a02"
},
"downloads": -1,
"filename": "mpltoolbox-24.5.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5144c2280ea7dbaa4038f71828bece95",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 19476,
"upload_time": "2024-05-24T12:12:31",
"upload_time_iso_8601": "2024-05-24T12:12:31.191263Z",
"url": "https://files.pythonhosted.org/packages/65/60/44a44b026fb540ef03c3ec26d17452993d882df918b164aab4254c6844a7/mpltoolbox-24.5.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3f5ec3afae2ca5850566f712d8f6da5c01d84fa76514fdbc3d9bcb80030c21e5",
"md5": "bfe0d00ed52f7edaed97f6eaf895c868",
"sha256": "873f131b390147b188ba2693c95544a55ee923a0fefa3349d1bcfa74de1e46ae"
},
"downloads": -1,
"filename": "mpltoolbox-24.5.1.tar.gz",
"has_sig": false,
"md5_digest": "bfe0d00ed52f7edaed97f6eaf895c868",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 150518,
"upload_time": "2024-05-24T12:12:32",
"upload_time_iso_8601": "2024-05-24T12:12:32.875461Z",
"url": "https://files.pythonhosted.org/packages/3f/5e/c3afae2ca5850566f712d8f6da5c01d84fa76514fdbc3d9bcb80030c21e5/mpltoolbox-24.5.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-24 12:12:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "scipp",
"github_project": "mpltoolbox",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "mpltoolbox"
}