Closed ggrrll closed 11 months ago
yes to have colors you need channel locations. You can add these with the set_montage method
Message ID: @.***>
ok thanks -- however, it would be nice to relax this constraint (basically, it can assign random positions, if they are not provided)
also because, when only one channel is selected, the line gets coloured (even without positions)...so, why not having them with multiple channels?
ps: the bug label can be removed of course
In that case how will you be able to tell which color correspond to which channel? We won't literally assign random channel positions and then plot a head inset showing those fake positions --- that would be misleading.
In principle we could use a different color scheme/map (maybe just one uniform one, like viridis) that just colors by channel number/index. That would help differentiate lines while still making it at least somewhat clear that the colors are not spatial (since the colors gradients there indicate left/right anterior/posterior somehow IIRC). The name spatial_colors
becomes a bit weird there but we could live with it. Something like spatial_colors='order'
or something, where our default spatial_colors=True
can mean "'positions' if available, 'order' otherwise" so that by default channels always have different colors.
I guess I'd be OK with using viridis or plasma to assign colors based on channel sequence. It's still a bit misleading because it implies that channels that are adjacent in sequence are more similar than channels that are not adjacent in sequence. But I guess there's no way around that.
WDYT about a warning or info, like "spatial_colors requested but channel positions not found, falling back to sequential color map." That way we don't have to support any new string-based param values. I guess my assumption underlying that suggestion is that nobody would ever choose sequence-based coloring if they had location info available, so YAGNI the ability to specifically ask for it. Do you think that's right?
glad to see that this sparked a discussion for FR :)
@larsoner got my point I guess
this is my current use case: we do not have positions, we are just testing different electrodes types, which are located very close to each other. So, to answer to @drammock we differentiate simply by the channel id (which is a meaningful name, related to the experimental condition) Currently I am plotting the spectra 'by hand' (a bit of matplotilib code), where my legend is indeed made of channel names
rather than complicating these on mne side @ggrrll I would suggest you make up a default/random montage for your data. It is pretty trivial to do with
https://mne.tools/stable/generated/mne.channels.make_dig_montage.html
my 2c
@ggrrll can you see if that takes care of your use case?
hi,
sorry for the late reply -- we stopped working with that long time ago, an I am soon leaving the company
Okay I'll close then!
Description of the problem
I am plotting the spectra of few channels with
compute_psd().plot(spatial_colors=False)
I was expecting some colours, like in the 'midline' plot here https://mne.tools/stable/auto_tutorials/raw/40_visualize_raw.html#plotting-spectral-density-of-continuous-data
does
mne
plot colours only if there are spacial information ? if yes, this is not a bug, but rather a feature requestSteps to reproduce
try to plot spectra of a
mne.io.RawArray
objectLink to data
No response
Expected results
a colour for each channel
Actual results
no colors
Additional information