Histogram in Data Science (original) (raw)

Last Updated : 2 Feb, 2026

A histogram is a graphical representation of the frequency distribution of continuous series using rectangles. The x-axis of the graph represents the class interval and the y-axis shows the various frequencies corresponding to different class intervals.

histogram

Histogram

Types of Histogram

Histograms of Frequency Distribution are of two types:

1. Histogram of Equal Class Intervals

When histograms are drawn based on the data with equal class intervals, they are known as Histograms of equal class intervals. The histogram of equal class intervals includes rectangles with equal width; however, the length of the rectangles is proportional to the frequency distribution of the class intervals.

**Example of Histogram of Equal Class Intervals:

Present the following information in the form of a Histogram:

marks

Equal Class Intervals

histogram_of_equal_intervals

Histogram of Equal Intervals

2. Histogram of Unequal Class Intervals

When histograms are drawn based on the data with unequal class intervals, they are known as Histograms of unequal class intervals. Histogram of unequal class intervals includes rectangles of different width sizes. Therefore, before drawing a histogram in case of unequal class intervals, frequency distribution has to be adjusted.

**Adjustment of frequencies of unequal class intervals:

1. Determine the class of the smallest interval ( lowest class interval ).

2. Then, calculate the adjustment factor using the formula:

\text{Adjustment Factor for any Class} = \frac{\text{Class Interval of the Concerned Class}}{\text{Lowest Class Interval}}

3. Now, adjust the given frequencies using the adjustment factor:

Frequency~Density=\frac{Given~Frequency}{Adjustment~Factor}

**Example of Histogram of Unequal Class Intervals:

Present the following information in the form of a Histogram:

number_of_workers

Wages vs Number of Workers

1. It can be seen clearly that the given class interval is unequal. So, before plotting the histogram, frequencies have to be adjusted.

2. Determine the class of the smallest interval, i.e., 10-15. Thus, the lowest class interval in the given frequency distribution is 5.

3. Formulate the Adjusted Table as shown below:

wages

Adjusted Table

In the above table, the class interval is calculated as the difference between the upper-class limit and lower-class limit, i.e.,

15- 10 =5, 20- 15= 5, 20- 25 =5, 30- 25= 5, 40- 30= 10, 60- 40= 20 and 80- 60= 20.

4. Plotting Histogram:

histogram_of_unique_intervals

Histogram of Unique Interval