<jupyter_start><jupyter_text>Basic Histogram<jupyter_code>np.random.seed(0)
x_data = np.random.randn(100)
x_sc = LinearScale()
y_sc = LinearScale()

hist = Hist(sample=x_data, scales={'sample': x_sc, 'count': y_sc})
ax_x = Axis(scale=x_sc, tick_format='0.2f')
ax_y = Axis(scale=y_sc, orientation='vertical')

Figure(marks=[hist], axes=[ax_x, ax_y], padding_y=0)
hist.count
# Changing the number of bins
hist.bins = 20<jupyter_output><empty_output><jupyter_text>Properties of Histogram<jupyter_code># normalizing the count

x_sc = LinearScale()
y_sc = LinearScale()

hist = Hist(sample=x_data, scales={'sample': x_sc, 'count': y_sc}, normalized=True)
ax_x = Axis(scale=x_sc, tick_format='0.2f')
ax_y = Axis(scale=y_sc, orientation='vertical')

Figure(marks=[hist], axes=[ax_x, ax_y], padding_y=0)
# changing the color
hist.colors=['orangered']
# stroke and opacity update
hist.stroke = 'orange'
hist.opacities = [0.5] * hist.bins<jupyter_output><empty_output><jupyter_text>Read-only properties of Histogram<jupyter_code>x_sc = LinearScale()
y_sc = LinearScale()

hist = Hist(sample=x_data, scales={'sample': x_sc, 'count': y_sc})
ax_x = Axis(scale=x_sc, tick_format='0.2f')
ax_y = Axis(scale=y_sc, orientation='vertical')

Figure(marks=[hist], axes=[ax_x, ax_y], padding_y=0)
# count is the number of elements in each interval
hist.count
# mid points are the mid points of each interval
hist.midpoints<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup