INM-6 / swan

Swan (Sequential Waveform Analyzer) is an open-source graphical tool for tracking single units across multiple sessions of electrophysiological data that was recorded using chronically implanted microelectrode arrays.
BSD 3-Clause "New" or "Revised" License
5 stars 2 forks source link

Error in virtual unit map plotting #21

Closed shashwatsridhar closed 3 years ago

shashwatsridhar commented 3 years ago

On data load, this error halts the GUI.

Traceback (most recent call last):
  File "/home/shashwat/PycharmProjects/swan/swan/main.py", line 304, in on_action_load_project_triggered
    if success and self.do_channel(self._my_storage.get_channel(), self._my_storage.get_last_channel()):
  File "/home/shashwat/PycharmProjects/swan/swan/main.py", line 709, in do_channel
    self.plot_all()
  File "/home/shashwat/PycharmProjects/swan/swan/main.py", line 757, in plot_all
    self.vu.do_plot(vum_all, data)
  File "/home/shashwat/PycharmProjects/swan/swan/views/virtual_units_view.py", line 215, in do_plot
    self._axes.set_xticklabels([str(i) for i in range(1, l+1)])
  File "/home/shashwat/miniconda3/envs/swan_new/lib/python3.9/site-packages/matplotlib/axes/_base.py", line 63, in wrapper
    return get_method(self)(*args, **kwargs)
  File "/home/shashwat/miniconda3/envs/swan_new/lib/python3.9/site-packages/matplotlib/cbook/deprecation.py", line 451, in wrapper
    return func(*args, **kwargs)
  File "/home/shashwat/miniconda3/envs/swan_new/lib/python3.9/site-packages/matplotlib/axis.py", line 1796, in _set_ticklabels
    return self.set_ticklabels(labels, minor=minor, **kwargs)
  File "/home/shashwat/miniconda3/envs/swan_new/lib/python3.9/site-packages/matplotlib/axis.py", line 1717, in set_ticklabels
    raise ValueError(
ValueError: The number of FixedLocator locations (11), usually from a call to set_ticks, does not match the number of ticklabels (10).

Simple fix by adjusting the arguments to range in this line.