MetaCell / nwb-explorer

NWB Explorer is a web application to visualise and analyse the content of NWB:N 2 files
Other
24 stars 16 forks source link

Deterministic colours for Plot all #216

Open pgleeson opened 4 years ago

pgleeson commented 4 years ago

A minor cosmetic thing, but might be good for data presentation. Can the sequence of colors used when plotting multiple graphs be deterministic, i.e. the same sequence of colours are used for each Plot all call? Assuming of course that a timeseries hasn't already been plotted and assigned a color. That would make plots like this easier to interpret, i.e. matched colors for injected current 1 & membrane potentail 1, etc.

Screenshot 2020-10-23 at 09 56 47
filippomc commented 4 years ago

I understand that the final goal is to have stimulus and acquisition colors matching, and I don't see a good way to implement it consistently by using the color assign sequence. What about using the sweep number to match the color instead (If present)?

pgleeson commented 4 years ago

I guess one way is to have the traces ordered alphabetically (by label), and then have a fixed colour list for the traces, applied in order. Then they would automatically match if the only difference in the names of the traces in each is 01, 02, etc.

filippomc commented 4 years ago

I don't know how to scale this on different searches.. and can't really rely on the name because every file can have its conventions. I feel more comfortable in using the sweep number if that fits your needs

pgleeson commented 4 years ago

Sure, use the sweep number, that should align between current/voltage for most data of this type. The sweep number is not required though? Maybe then fall back to the label?

What I'm assuming is: 1) try to order traces based on sweep number 2) if no sweep number order based on name 3) only once the order is decided are colours handed out...