Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions spikeinterface_gui/basescatterview.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def get_unit_data(self, unit_id, segment_index=0):
return spike_times, spike_data, np.array([1]), np.array([ymin, ymax]), ymin, ymax, inds

# avoid clear outliers in the plot and histogram by using percentiles
ymin, ymax = np.percentile(spike_data, [self.settings['display_low_percentiles'], self.settings['display_high_percentiles']])
ymin, ymax = np.percentile(spike_data[~np.isnan(spike_data)], [self.settings['display_low_percentiles'], self.settings['display_high_percentiles']])
min_bin_size = np.min(np.diff(np.unique(spike_data)))
bins = np.linspace(ymin, ymax, self.settings['num_bins'])
# if bins are too small, adjust the number of bins to ensure a minimum bin size and avoid jumps in the histogram
Expand Down Expand Up @@ -329,8 +329,8 @@ def _qt_refresh(self, set_scatter_range=False):
# set x range to time range of the current segment for scatter, and max count for histogram
# set y range to min and max of visible spike amplitudes
if len(ymins) > 0 and (set_scatter_range or not self._first_refresh_done):
ymin = np.min(ymins)
ymax = np.max(ymaxs)
ymin = np.nanmin(ymins)
ymax = np.nanmax(ymaxs)
t_start, t_stop = self.controller.get_t_start_t_stop()
self.viewBox.setXRange(t_start, t_stop, padding = 0.0)
self.viewBox.setYRange(ymin, ymax, padding = 0.0)
Expand Down
Loading
Loading