Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions spikeinterface_gui/basescatterview.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,11 @@ def initialize_plot(self):
self.viewBox = ViewBoxHandlingLasso()
self.viewBox.lasso_drawing.connect(self.on_lasso_drawing)
self.viewBox.lasso_finished.connect(self.on_lasso_finished)
self.viewBox.disableAutoRange()
Copy link
Member Author

Choose a reason for hiding this comment

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

@alejoe91 I think this was added in the lasso PR. But I don't think it's needed - my lassoing still works! Can you check?

self.plot = pg.PlotItem(viewBox=self.viewBox)
self.graphicsview.setCentralItem(self.plot)
self.plot.hideButtons()

self.viewBox2 = ViewBoxHandlingLasso()
self.viewBox2.disableAutoRange()
self.plot2 = pg.PlotItem(viewBox=self.viewBox2)
self.graphicsview2.setCentralItem(self.plot2)
self.plot2.hideButtons()
Expand All @@ -128,8 +126,7 @@ def initialize_plot(self):
self.plot.addItem(self.scatter)

self._text_items = []

self.plot.setYRange(self._data_min,self._data_max, padding = 0.0)


def _qt_on_spike_selection_changed(self):
self.refresh()
Expand Down Expand Up @@ -162,11 +159,13 @@ def _qt_refresh(self):
max_count = max(max_count, np.max(hist_count))

self._max_count = max_count
seg_index = self.combo_seg.currentIndex()
time_max = self.controller.get_num_samples(seg_index) / self.controller.sampling_frequency

self.plot.setXRange( 0., time_max, padding = 0.0)

self.plot.getViewBox().autoRange(padding = 0.0)
self.plot2.setXRange(0, self._max_count, padding = 0.0)

# explicitly set the y-range of the histogram to match the spike data
y_range_plot_1 = self.plot.getViewBox().viewRange()
self.viewBox2.setYRange(y_range_plot_1[1][0], y_range_plot_1[1][1], padding = 0.0)

spike_times, spike_data = self.get_selected_spikes_data()
self.scatter_select.setData(spike_times, spike_data)
Expand Down