python holoviews layout tabs with columns

402 Views Asked by At

I have here a very simplified example:

plot = []
for d in range(2):
    name=str(d)
    data = pd.DataFrame({'x':[2,5,1], 'y':[3,1,6], 'm':[1,2,3]})
    x = hv.Curve(data, 'm', 'x', label=name)
    y = hv.Curve(data, 'm', 'y', label=name)
    uu = hv.Layout(x+y).cols(1)
    plot.append(uu)

hv.Layout(plot).opts(tabs = True)

The result is a number of plots in separated tabs (4 plots in 4 tabs). However, I wish to get two plots as in here

hv.Layout(x+y).cols(1)

combined with a layout in tabs (each tab contains two plots in one column).

Thanks

1

There are 1 best solutions below

0
Sander van den Oord On

I don't know if this can also be done directly within HoloViews, but using pn.Tabs() is a quick solution:

import panel as pn
pn.extension()

pn.Tabs(('plot 0', plot[0]), ('plot 1', plot[1]))