Concept

Histograms

To create a histogram, use plt.hist() plt.hist() requires one argument, 'x', which represents the input values and is usually an array or a sequence of arrays. With a second input parameter, we can control the bins by giving it an integer or an array. plt.hist(np.random.randn(1000), 5) produces the graph in the image.

It is also possible to animate a histogram after including import matplotlib.animation as animation and creating a function to animate the bars.

Image 0

0

1

Updated 2021-05-08

Tags

Data Science

Related