interactive marker support for matplotlib
Project description
mpl-markers
Interactive data markers for line plots in matplotlib
Installation
pip install mpl-markers
Usage
import mpl_markers as mplm
Add a marker attached to plotted data lines:
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('ggplot')
plt.rc('font', size=7)
fig, ax = plt.subplots(1,1)
x1 = np.linspace(-2*np.pi, 2*np.pi, 1000)
ax.plot(x1, np.sin(x1)*np.cos(x1)**2)
mplm.data_marker(x=0)
The marker can be dragged to any location along the data line, or moved incrementally with the left/right arrow keys.
Add an axis marker that moves freely on the canvas:
ax.xaxis.set_major_formatter(lambda x, pos: '{:.2f}$\pi$'.format(x/np.pi))
mplm.axis_marker(x=0, y=-0.2)
License
mpl-markers is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mpl-markers-0.0.3.tar.gz
(18.4 kB
view hashes)
Built Distribution
Close
Hashes for mpl_markers-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f9989464ae5c54f22ae3a40c2e06562f2dc720e8207c1309958a846e2223357 |
|
MD5 | 0a76d87f2e80dec845edac5c829f8248 |
|
BLAKE2b-256 | fe5ee292eeb4a4ce2cda457799c316e9713a98fd363be2e5d2edfe3284744103 |