import numpy as np import holoviews as hv from holoviews import opts hv.extension('bokeh') np.random.seed(1) data = np.random.randn(10000) frequencies, edges = np.histogram(data, 20) print('Values: %s, Edges: %s' % (frequencies.shape[0], edges.shape[0])) hv.Histogram((edges, frequencies)) xs = np.linspace(0, np.pi*2) ys = np.sin(xs) curve = hv.Curve((xs, ys)) curve + hv.Histogram(curve) hv.Histogram(curve).opts( opts.Histogram(fill_color=hv.dim('y').bin(bins=[-1, 0, 1], labels=['red', 'blue']))) points = hv.Points(np.random.randn(100,2)) points.hist(dimension=['x','y']) from holoviews.operation import histogram points2 = hv.Points(np.random.randn(100,2)*2+1) xhist, yhist = (histogram(points2, bin_range=(-5, 5), dimension=dim) * histogram(points, bin_range=(-5, 5), dimension=dim) for dim in 'xy') composition = (points2 * points) << yhist.opts(width=125) << xhist.opts(height=125) composition.opts(opts.Histogram(alpha=0.3))