How can I set the column wrapping when using panel with hvplot? Doing this without panel is pretty easy using the cols
method:
import pandas as pd
import hvplot.pandas
us_crime = pd.read_csv('https://raw.githubusercontent.com/holoviz/hvplot/master/examples/data/crime.csv')
us_crime.hvplot.hist(['Robbery', 'Robbery rate', 'Burglary', 'Burglary rate'],
width=350, height=300, subplots=True, shared_axes=False).cols(2)
The problem occurs when, for example, I want to make the bin number adjustable using panel. Consider this example:
import panel as pn
import pandas as pd
import hvplot.pandas
us_crime = pd.read_csv('https://raw.githubusercontent.com/holoviz/hvplot/master/examples/data/crime.csv')
binslider = pn.widgets.IntSlider(start=1, end=100, value=20, name='Number of bins')
histplot = us_crime.hvplot.hist(['Robbery', 'Robbery rate', 'Burglary', 'Burglary rate'],
width=350, height=300, subplots=True, shared_axes=False, bins=binslider)
pn.Column(binslider, histplot)
If this wasn’t using panel, I could do histplot.cols(2)
. But when panel is used, there is no histplot.cols
method because histplot
is a different class. I tries to check if there was some way to access the underlying object so I could call cols
on that, but I couldn’t find one. Does anyone know how I can do this? In this example it isn’t a big deal, but I have a lot of plots so putting them on one row entails a lot of horizontal scrolling.
Thanks a lot for your help!