paulbrodersen / somnotate

Automated polysomnography for experimental animal research
GNU General Public License v3.0
14 stars 7 forks source link

Error when plotting more than 3 signals #17

Closed rjp109 closed 1 month ago

rjp109 commented 1 month ago

When running 05_manual_refinement.py I get the following error when trying to plot more than 3 signals. My configuration file definitely incudes the same number of signals as signal labels, I think this is an issue with _plotting.py, but i can't quite figure it out.

(somnotate_env) C:\Users\rp17047\somnotate>python C:\Users\rp17047\somnotate\example_pipeline\05_manual_refinement.py C:\Users\rp17047\22qScore\TestingSet.csv C:\Users\rp17047\22qScore\EDFs\150193_2024-02-07.edf (1/6) Traceback (most recent call last): File "C:\Users\rp17047\somnotate\example_pipeline\05_manual_refinement.py", line 156, in <module> plot_raw_signals( File "C:\Users\rp17047\somnotate\example_pipeline\configuration.py", line 98, in plot_raw_signals ax = plot_signals(filtered, File "C:\Users\rp17047\somnotate\somnotate\_plotting.py", line 90, in plot_signals ax.set_yticklabels(signal_labels) File "C:\Users\rp17047\AppData\Local\miniconda3\envs\somnotate_env\lib\site-packages\matplotlib\axes\_base.py", line 74, in wrapper return get_method(self)(*args, **kwargs) File "C:\Users\rp17047\AppData\Local\miniconda3\envs\somnotate_env\lib\site-packages\matplotlib\axis.py", line 2062, in set_ticklabels raise ValueError( ValueError: The number of FixedLocator locations (5), usually from a call to set_ticks, does not match the number of labels (4).

paulbrodersen commented 1 month ago

In example_pipeline/configuration.py, ll. 27, are there as many state_annotation_signals as state_annotation_signal_labels?

rjp109 commented 1 month ago

Ack, I double checked and there was a missing comma, I am very sorry for the bother! I think I'm pretty much there now with this pipeline. Thank you so much again for all your help with this. I need to check over how well it works for my data, but it seems to be a fantastic tool, I will def be citing and recommending in the future :)

paulbrodersen commented 1 month ago

Cheers, glad you like it! Let me know if anything else comes up.