holoviz / holoviews

With Holoviews, your data visualizes itself.
https://holoviews.org
BSD 3-Clause "New" or "Revised" License
2.69k stars 402 forks source link

Add support for subcoordinate_group drawn from NdOverlay dimensions #6270

Open philippjfr opened 3 months ago

philippjfr commented 3 months ago

Instead of drawing the subcoordinate grouping from the Element.group you can now specify a multi-dimensional NdOverlay and draw the group from one of the dimensions, e.g.:

import numpy as np
import holoviews as hv

hv.extension('bokeh')

data = {
    ('EEG', f'EEG {i}'): hv.Curve(
        np.random.randn(100).cumsum()+i
    ).opts(subcoordinate_y=True)
    for i in range(3)
}
data.update({
    ('MEG', f'MEG {i}'): hv.Curve(
        -np.random.randn(100).cumsum()+i
    ).opts(subcoordinate_y=True)
    for i in range(3)
})

hv.NdOverlay(data, ['Group', 'Channel']).opts(
    responsive=True, height=400, subcoordinate_group='Group'
)
Screenshot 2024-06-07 at 17 38 52