Skip to main content

mpl-measurements add measurements to your matplotlib plots

Project description

mpl-measurements

Interactive measurement tools for Matplotlib.

Click two points on any plotted line to compute engineering-style measurements such as Δx, Δy, and signal statistics (min, max, RMS) over a selected interval.

mpl-measurements

To use it, simply call InteractiveScope(fig) where fig is your figure. Example:

import numpy as np
import matplotlib.pyplot as plt

from mpl_measurements import InteractiveScope

x = np.linspace(0, 10, 1000)
fig, axs = plt.subplots(2, 2, sharex=True, squeeze=False)

for ii, ax in enumerate(axs):
    ax.plot(x, np.sin(x + ii), label=f"sin {ii}", picker=5)
    ax.plot(x, np.cos(x + ii), label=f"cos {ii}", picker=5)
    ax.set_title(f"Axes {ii}")
    ax.legend()

scope = InteractiveScope(fig) # This is the line!

# You can also call e.g. InteractiveScope(fig, axes=[axs[0], axs[1]]) if you
# want the measurements tool active only on axes axs[0], axs[1]

plt.show()

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

mpl_measurements-0.0.4.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mpl_measurements-0.0.4-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file mpl_measurements-0.0.4.tar.gz.

File metadata

  • Download URL: mpl_measurements-0.0.4.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for mpl_measurements-0.0.4.tar.gz
Algorithm Hash digest
SHA256 1a1db78621449e9dc53bf0f950cb5c01066390a9282dc7c4296128aa8050ce29
MD5 90bec8b16954febfc7b4f8a37d9eebf6
BLAKE2b-256 f3f7935018190e1e7ea281f3071d619e97370e1ec0ec5ad2cc362f4819cc724b

See more details on using hashes here.

File details

Details for the file mpl_measurements-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for mpl_measurements-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2009d4f1b41a5fa2c82af68e95e48b8dea44648e2fcd18bdf95e57cd7a6138ef
MD5 a6527b4d9a6fff6a8dd4d4ef60bc20ab
BLAKE2b-256 c132873f73424232965d198237801992306cffecfb7ef4f82d38bba6eaeb7cae

See more details on using hashes here.

Supported by

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