Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

linear region selector #146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 34 commits into from
Closed

linear region selector #146

wants to merge 34 commits into from

Conversation

kushalkolar
Copy link
Member

starts #142

wonky right now with the controls, need to make it move along exactly with the deltas of the mouse

from fastplotlib.graphics.selectors.linear import LinearSelector
from fastplotlib import Plot
import numpy as np
from ipywidgets import VBox

ls = LinearSelector((0, 100), 300, (0, 0))

plot1 = Plot()

xs = np.linspace(0, 400, 1000)
sine = np.sin(xs) * 100

sg = plot1.add_line(sine)
plot1.add_graphic(ls)

plot2 = Plot()
zoomed = plot2.add_line(np.zeros(100))

def set_zoom_plot(ev):
    bounds = ev.pick_info["new_data"]
    
    zoomed.data = sg.data()[100:200]
    zoomed.data= sg.data()[bounds[0]:bounds[1]]
    plot2.auto_scale()


ls.bounds.add_event_handler(set_zoom_plot)

VBox([plot1.show(), plot2.show()])
linear_region-2023-03-05_06.54.19.mp4

@clewis7
Copy link
Member

clewis7 commented Mar 8, 2023

Is this to replace adding a line to trace over temporal traces in sync with slider?

kushalkolar and others added 25 commits March 8, 2023 23:33
ImageWidget fix frame_apply(), add grid_plot_kwargs(), reset_vmin_vmax()
temporary workaround for image and heatmap data buffers
garbage collection of WorldObjects
@kushalkolar
Copy link
Member Author

superseeded by #164

@kushalkolar kushalkolar deleted the selectors branch May 23, 2023 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.