Histogram#
A histogram showing the distribution of a numeric variable built from random data.
import pandas as pd
import numpy as np
import hvplot.pandas # noqa
np.random.seed(42)
df = pd.DataFrame({'values': np.random.normal(loc=0, scale=1, size=500)})
df.hvplot.hist(
y='values',
bins=30,
title='Histogram (Bokeh)',
xlabel='Value',
ylabel='Density'
)
import pandas as pd
import numpy as np
import hvplot.pandas # noqa
hvplot.extension('matplotlib')
np.random.seed(42)
df = pd.DataFrame({'values': np.random.normal(loc=0, scale=1, size=500)})
df.hvplot.hist(
y='values',
bins=30,
title='Histogram (Matplotlib)',
xlabel='Value',
ylabel='Density'
)
See also
This web page was generated from a Jupyter notebook and not all
interactivity will work on this website.