Draggable data windowing for matplotlib plots
Project description
matplotlib-window
Draggable data windowing for matplotlib plots. Inspired by the adventures of past me and dragpy
.
Interface
For most use cases, interaction with this library is done via the helper wrappers in matplotlib_window.window
. These functions will accept the user data and build the plots directly for windowing.
fixed_window
Plot the provided data & build a draggable fixed-width window to select bounds of interest; the x-locations of the edges of the window are returned once the figure window is closed.
Parameters
Parameter | Description | Type | Default |
---|---|---|---|
x_data |
x data values to plot | Sequence[int|float] |
Required |
y_data |
y data values to plot | Sequence[int|float] |
Required |
position |
x-coordinate of the left edge of the window | int|float |
Required |
window_width |
Width, along the x-axis, of the draggable window | int|float |
Required |
snap_to_data |
Prevent dragging of the window beyond beyond the bounds of the plotted data | bool |
True |
axes_kwargs |
Optional kwargs to pass to the Axes constructor1 |
dict[str, Any] |
{"title": ...} |
plot_kwargs |
Optional kwargs to pass to the plotting call2 | dict[str, Any] |
{} |
- kwargs are passed directly to the
Axes
constructor, see thematplotlib.axes.Axes
documentation for supported arguments. - kwargs are passed directly to the plotting call, see the
matplotlib.pyplot.plot
documentation for supported arguments.
flexible_window
Plot the provided data & build a flexible-width window to select bounds of interest; the x-locations of the edges of the window are returned once the figure window is closed.
Parameters
Parameter | Description | Type | Default |
---|---|---|---|
x_data |
x data values to plot | Sequence[int|float] |
Required |
y_data |
y data values to plot | Sequence[int|float] |
Required |
position |
x-coordinate of the left edge of the window | int|float |
Required |
window_width |
Starting width, along the x-axis, of the flexible window | int|float |
Required |
snap_to_data |
Prevent dragging of the window beyond beyond the bounds of the plotted data | bool |
True |
allow_face_drag |
Allow dragging of the window using its face1 | bool |
False |
axes_kwargs |
Optional kwargs to pass to the Axes constructor2 |
dict[str, Any] |
{"title": ...} |
plot_kwargs |
Optional kwargs to pass to the plotting call3 | dict[str, Any] |
{} |
- Currently not implemented
- kwargs are passed directly to the
Axes
constructor, see thematplotlib.axes.Axes
documentation for supported arguments. - kwargs are passed directly to the plotting call, see the
matplotlib.pyplot.plot
documentation for supported arguments.
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
Built Distribution
File details
Details for the file matplotlib_window-1.0.0.tar.gz
.
File metadata
- Download URL: matplotlib_window-1.0.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 551f4b5fb94ee4b485bb5ab4c8786d04adee9edb5f24a6ed09148d1410c7e2dc |
|
MD5 | a87cdf0bbe9085d4d9484f105eecf0c1 |
|
BLAKE2b-256 | 7baf215ebbe42298de62a6bb38c3b782b39e223d62ce8d9051a432cb5edfed82 |
File details
Details for the file matplotlib_window-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: matplotlib_window-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c1ce4317e874f73c2b8ebc5385c559995d76f9432a561a8c47f0a8179fc3cca |
|
MD5 | de7d7f7d788fd5dddb45322461810ce2 |
|
BLAKE2b-256 | 5772d1aefe5cafdfb5df3c4949cdb51d60b777b19b76e13a320bf6242d0d7499 |