Boxwhisker

Title
BoxWhisker Element
Dependencies
Matplotlib
Backends
Matplotlib
Bokeh
In [1]:
import numpy as np
import holoviews as hv
hv.extension('matplotlib')

A BoxWhisker Element is a quick way of visually summarizing one or more groups of numerical data through their quartiles.

The data of a BoxWhisker Element may have any number of key dimensions representing the grouping of the value dimension and a single value dimensions representing the distribution of values within each group. See the Columnar Data Tutorial for supported data formats, which include arrays, pandas dataframes and dictionaries of arrays.

Without any groups a BoxWhisker Element represents a single distribution of values:

In [2]:
hv.BoxWhisker(np.random.randn(1000), vdims=['Value'])
Out[2]:

By supplying key dimensions we can compare our distributions across multiple variables.

In [3]:
%%opts BoxWhisker [width=600 height=400 show_legend=False] (whisker_color='gray' color='white')
groups = [chr(65+g) for g in np.random.randint(0, 3, 200)]
hv.BoxWhisker((groups, np.random.randint(0, 5, 200), np.random.randn(200)),
              kdims=['Group', 'Category'], vdims=['Value']).sort()
Unexpected style option 'color' for BoxWhisker in loaded backends 'bokeh' and 'matplotlib'.

Possible keywords in the currently active 'matplotlib' renderer are: [u'bootstrap', u'boxprops', u'capprops', u'conf_intervals', u'flierprops', u'meanline', u'meanprops', u'medianprops', u'notch', u'show_caps', u'showfliers', u'showmeans', u'sym', u'whis', u'whiskerprops', u'widths']

If you believe this keyword is correct, please make sure the backend has been imported or loaded with the hv.extension.
Out[3]:

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