Skip to main content

Interactive tools for matplotlib

Project description

PyPI version Anaconda-Server Badge Documentation Status License: BSD 3-Clause Binder

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

pip install mpltoolbox

Examples

import matplotlib.pyplot as plt
import mpltoolbox as tbx
%matplotlib widget

Points

fig, ax = plt.subplots()
ax.set_xlim(0, 100)
ax.set_ylim(0, 100)

points = tbx.Points(ax=ax)

points

Lines

fig, ax = plt.subplots()
ax.set_xlim(0, 100)
ax.set_ylim(0, 100)

lines = tbx.Lines(ax=ax, n=2)

lines

Rectangles

fig, ax = plt.subplots()
ax.set_xlim(0, 100)
ax.set_ylim(0, 100)

rectangles = tbx.Rectangles(ax=ax)

rects

Ellipses

fig, ax = plt.subplots()
ax.set_xlim(0, 100)
ax.set_ylim(0, 100)

ellipses = tbx.Ellipses(ax=ax)

ellipses

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mpltoolbox-24.4.0.tar.gz (149.8 kB view hashes)

Uploaded Source

Built Distribution

mpltoolbox-24.4.0-py3-none-any.whl (19.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page