import hvplot.pandas # noqa
box
plots are most useful when grouped by additional dimensions.
from bokeh.sampledata.sprint import sprint as df
df.head()
boxplot = df.hvplot.box(y='Time', by='Medal', height=400, width=400, legend=False)
boxplot
Overlay this plot with the jittered scatter plot of the medalist times using the *
operator:
boxplot * df.hvplot.scatter(y='Time', x='Medal', c='orange').opts(jitter=0.5)
Use groupby
to create a separate plot for each medal type with a widget for selecting between the plots.
df.hvplot.box(y='Time', groupby='Medal', by='Country', ylabel='Sprint Time', height=400, width=600)