import panel as pn import numpy as np import holoviews as hv pn.extension(sizing_mode="stretch_width") distributions = { 'NORMAL': np.random.normal, 'UNIFORM': np.random.uniform, 'LOG-NORMAL': np.random.lognormal, 'EXPONENTIAL': np.random.exponential } checkboxes = pn.widgets.ToggleGroup(options=distributions, behavior='radio', button_type="success") slider = pn.widgets.IntSlider(name='Number of observations', value=500, start=0, end=2000) @pn.depends(checkboxes.param.value, slider.param.value) def tabs(distribution, n): values = hv.Dataset(distribution(size=n), 'values') return pn.Tabs( ('Plot', values.hist(adjoin=False).opts( responsive=True, max_height=500, padding=0.1, color="#00aa41")), ('Summary', values.dframe().describe().T), ('Table', hv.Table(values)), ) selections = pn.Column('### Distribution Type', checkboxes, slider) pn.Row(selections, tabs) pn.template.FastListTemplate(site="Panel", title="Distribution Tabs", main=["This example demonstrates **how to plot several different types of outputs in a Tab**.", selections, tabs]).servable();