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.3.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.3-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mpl_measurements-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 d777cae5ee407b8cd14bd9d75aff3a14fe2c318d28b5309267d6693763ce2707
MD5 2fbab3d1d272b4697975f945df36b292
BLAKE2b-256 de5dd70c5a96dc673862471d9d3c59fd91b52bc8be364ca3b74ea9f7cae7b338

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mpl_measurements-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 86f1b14978d475281a8b2a246a8d89bb39c5ab6858c05ff22d6255ac5b35c877
MD5 a83163a37514384ae9afe71afe761aff
BLAKE2b-256 1d6c5a285e646451557396305cb397a3b0f07f102141c9503aea628de80fa29a

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