Skip to content

ecephys raster_plot plots each unit twice #1739

@dgmurx

Description

@dgmurx

Hi!

When running raster_plot (imported from allensdk.brain_observatory.ecephys.visualization) on a spike_times dataframe, the spike times from each unit is plotted twice (twice as many lines as it's supposed to).

This is because the function passed to pandas's aggregate (here, the call on the _VlPlotter object) is called on each column, thus once on the 'stimulus_presentation_id' and once on the 'time_since_stimulus_presentation_onset' column.

This can be fixed by passing only one column to the aggregate function, eg spike_times[['stimulus_presentation_id', 'unit_id']].groupby('unit_id').agg(plotter).

I'll follow up with a pull request in a moment!

Best
Daniel

Metadata

Metadata

Assignees

Labels

braintvrelates to Insitute BrainTV programbugexternalIssues submitted from external usersneuropixels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions