In [1]:
import numpy as np
import bqplot.pyplot as plt

Basic Histogram


In [2]:
np.random.seed(0)
x_data = np.random.randn(100)

In [3]:
fig = plt.figure(padding_y=0)
hist = plt.hist(x_data)
fig



In [4]:
hist.count


Out[4]:
array([], dtype=float64)

In [5]:
# Changing the number of bins
hist.bins = 20

Properties of Histogram


In [6]:
# normalizing the count
fig = plt.figure(padding_y=0)
hist = plt.hist(x_data, normalized=True)
fig



In [7]:
# changing the color
hist.colors=['orangered']

In [8]:
# stroke and opacity update
hist.stroke = 'orange'
hist.opacities = [0.5] * hist.bins

Read-only properties of Histogram


In [9]:
fig = plt.figure(padding_y=0)
hist = plt.hist(x_data, normalized=True)
fig



In [10]:
# count is the number of elements in each interval
hist.count


Out[10]:
array([], dtype=float64)

In [11]:
# mid points are the mid points of each interval
hist.midpoints


Out[11]:
[]