import hvplot.pandas # noqa
Kernel density estimate (kde
) provides a mechanism for showing the distribution and spread of the data. In hvplot
the method is exposed both as kde
and density
.
from bokeh.sampledata import sea_surface_temperature as sst
df = sst.sea_surface_temperature
df.tail()
df.hvplot.kde()
There are many options exposed and explorable using tab completion. In this case we'll create a colormap that spans the rainbow and divide the temperature by month.
import numpy as np
import colorcet as cc
categorical_cmap = [cc.rainbow[int(i)] for i in np.linspace(0, 255, 12)]
df.hvplot.kde(by='time.month', cmap=categorical_cmap, legend='top', height=400)