Distribution

Download this notebook from GitHub (right-click to download).


Title
Distribution Element
Dependencies
Plotly
Backends
Plotly
In [1]:
import numpy as np
import holoviews as hv
hv.extension('plotly')

A Distribution Element is a quick way of visualize the distribution of some data visualizing it as a a histogram or kernel density estimate. Unlike the Histogram Element Distribution wraps the raw data rather than representing the already binned data.

Here we will wrap a simple numpy array containing 1000 samples of a normal distribution.

In [2]:
hv.Distribution(np.random.randn(1000))
Out[2]:

Distribution Elements like all other Elements can be overlaid allowing us to compare two distributions:

In [3]:
hv.Distribution(np.random.randn(1000), label='#1') * hv.Distribution(np.random.randn(1000)+2, label='#2')
Out[3]:

For full documentation and the available style and plot options, use hv.help(hv.Distribution).


Download this notebook from GitHub (right-click to download).