Skip to content

Commit ee08f5a

Browse files
committed
allow UnitWaveformsWidget to use probeinterface plot_probe
1 parent a95dc57 commit ee08f5a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/spikeinterface/widgets/unit_waveforms.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,14 @@ def plot_matplotlib(self, data_plot, **backend_kwargs):
383383

384384
# plot channels
385385
if dp.plot_channels:
386-
# TODO enhance this
387-
ax.scatter(dp.channel_locations[:, 0], dp.channel_locations[:, 1], color="k")
386+
from probeinterface.plotting import plot_probe
387+
probe = dp.sorting_analyzer_or_templates.get_probe()
388+
poly, poly_contour = plot_probe(probe, contacts_colors='w', add_to_axis=False)
389+
ax.add_collection(poly)
390+
391+
# Apply axis_equal setting
392+
if dp.axis_equal:
393+
ax.set_aspect('equal')
388394

389395
if dp.same_axis and dp.plot_legend:
390396
if hasattr(self, "legend") and self.legend is not None:

0 commit comments

Comments
 (0)