Skip to content
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

Adding colorbar support to peak activity widget #3646

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

abhinavsns
Copy link

@abhinavsns abhinavsns commented Jan 27, 2025

I am following the tutorial located at: https://spikeinterface.readthedocs.io/en/stable/tutorials/widgets/plot_4_peaks_gallery.html
The feature for plotting and animating was already present. This PR adds support for the color bar which is not implemented.

Attached are the screenshot and gifs for the same tutorial when using with_color_bar and fixed_color_range arguments.
no_color_bar
with_color_bar
colorbarmoving
colorbarfixed

abhinavsns and others added 2 commits January 27, 2025 16:37
adding colorbar support with option of having variable/fixed range when animating
@alejoe91
Copy link
Member

alejoe91 commented Jan 28, 2025

Hi @abhinavsns

Thank you for the PR! Can you add more information in the PR description and a screenshot/screencast of the widget with the change?

@alejoe91 alejoe91 changed the title Adding colorbar support Adding colorbar support to peak activity widget Jan 28, 2025
@alejoe91 alejoe91 added the widgets Related to widgets module label Jan 28, 2025
Copy link
Collaborator

@zm711 zm711 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple initial questions from me. But I personally think this cool!

):
rates = self._compute_rates(rec, peaks, duration)

self.artists = ()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did we need to put the artists into the class? It seems like they only exist inside the function or am I misreading?

self._plot_one_bin(
rec, probe, peaks, duration, dp.with_channel_ids, dp.with_contact_color, dp.with_interpolated_map
)
if type(dp.fixed_color_range) in [tuple, list]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docstring only says tuple. This is a tiny point though so not sure we need to change.

rec, probe, peaks, duration, dp.with_channel_ids, dp.with_contact_color, dp.with_interpolated_map
)
if type(dp.fixed_color_range) in [tuple, list]:
self.vmin, self.vmax = dp.fixed_color_range
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you're just putting them into the function why do you need to pull them out and put them in the class?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
widgets Related to widgets module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants