CBSE Class 12 Informatics Practices Question 55 of 73

Data Visualization using Matplotlib — Question 20

Back to all questions
20
Question

Question 20

What is a histogram? How do you create histograms in Python?

Answer

A histogram is a summarization tool for discrete or continuous data, providing a visual interpretation of numerical data by showing the number of data points that fall within a specified range of values.

The hist() function of the Pyplot module is used to create and plot a histogram from a given sequence of numbers. The syntax for using the hist() function in Pyplot is as follows:

matplotlib.pyplot.hist(x, bins = None, cumulative = False, histtype = 'bar', align = 'mid', orientation = 'vertical', ).