How to Draw a Histogram in Python


In this example, we will learn how to draw a histogram in Python.

Source Code

import numpy
import matplotlib.pyplot as plt

a = numpy.random.uniform(0.0, 10.0, 500)
plt.hist(a, 10)
plt.show() 

Output:

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Advertisement