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.2.tar.gz (4.9 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.2-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mpl_measurements-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a846b1a4ec46074c713b7586b22f05cef46898073e84e96c9e072620aaa74547
MD5 084b954c89ad8bace9ffdf9cf22e9d91
BLAKE2b-256 bd1a34dbdcffb0c9b13be019c453b69942e778c36e697f2801af8ace480b1a7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mpl_measurements-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 92b4bdbae777a1dce7017409608660795836646c69ea9cb3fc99154c089721fe
MD5 f49d8642906154b299e522b3361532a7
BLAKE2b-256 459236430dd356997576d1ca3ba806a0eefa2a4c2c621d6b500d589bbe9808a4

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