Closed ococrook closed 3 years ago
Sorry for my late reply. Indeed a good point. I will fix ASAP.
It's implemented. Now you plotSpectra
and plotSpectraMirror
no longer fails when called on an empty spectrum.
Feel free to re-open if this did not fix your problem.
cheers, I'll double check it work for me
Sometime it reasonable to try to plot an empty spectra - for large pipelines where we are searching for potential peptide and the expected peptide happens to be missing.
However, a number of the plotting functions fail when trying to plot empty spectra (unsuprinsgly), but its not that elegent.
The problem is that max of an empty or NULL is -Inf which leads to nonsense xlim or ylim values. I would suggest including a 0 in the max when setting xlim and ylim to avoid the issue or checking if the spectra is empty and return an empty plot?