import panel as pn import hvplot.pandas # noqa from bokeh.sampledata.iris import flowers flowers.hvplot.bivariate(x='sepal_width', y='sepal_length', width=600, groupby='species') flowers.hvplot.bivariate(x='sepal_width', y='sepal_length', width=600, groupby='species', widget_location='left_top') flowers.hvplot.bivariate(x='sepal_width', y='sepal_length', width=600, groupby='species', widgets={'species': pn.widgets.DiscreteSlider}) x = pn.widgets.Select(name='x', options=['sepal_width', 'petal_width']) y = pn.widgets.Select(name='y', options=['sepal_length', 'petal_length']) kind = pn.widgets.Select(name='kind', value='scatter', options=['bivariate', 'scatter']) plot = flowers.hvplot(x=x, y=y, kind=kind, colorbar=False, width=600) pn.Row(pn.WidgetBox(x, y, kind), plot) x = pn.widgets.Select(name='x', options=['sepal_width', 'petal_width']) y = pn.widgets.Select(name='y', options=['sepal_length', 'petal_length']) kind = pn.widgets.Select(name='kind', value='scatter', options=['bivariate', 'scatter']) by_species = pn.widgets.Checkbox(name='By species') color = pn.widgets.ColorPicker(value='#ff0000') @pn.depends(by_species, color) def by_species_fn(by_species, color): return 'species' if by_species else color plot = flowers.hvplot(x=x, y=y, kind=kind, c=by_species_fn, colorbar=False, width=600, legend='top_right') pn.Row(pn.WidgetBox(x, y, kind, color, by_species), plot) def update(event): if kind.value == 'bivariate': color.disabled = True by_species.disabled = True else: color.disabled = False by_species.disabled = False kind.param.watch(update, 'value');