Wednesday, December 14, 2022

How bar plots are different from histograms

 In simple terms, the main difference between bar plots and histograms is the type of variable they are used to display. Bar plots are used for categorical variables, while histograms are used for continuous variables.


Example:

Imagine you are trying to compare the heights of your classmates. You measure the height of each classmate and write down the numbers. To make it easier to compare the heights, you can put the numbers into groups, or bins, based on their height. For example, you can put all the heights that are between 4 feet and 4 feet 6 inches into one bin, all the heights that are between 4 feet 6 inches and 5 feet into another bin, and so on. This will help you see how many people are in each height range.


To make a histogram, you can draw a bar for each bin. The height of each bar represents the number of people in that bin. So, if you have 5 people who are between 4 feet and 4 feet 6 inches, the bar for that bin would be 5 units tall. This will help you see which height ranges have the most people and which have the fewest.


On the other hand, if you want to compare the favorite colors of your classmates, you can ask each person what their favorite color is and write down their responses. To make a bar plot, you can draw a bar for each color. The height of each bar represents the number of people who chose that color. So, if 3 people chose red as their favorite color, the bar for red would be 3 units tall. This will help you see which colors are the most popular among your classmates.


So, the main difference between a histogram and a bar plot is the type of variable they are used to display. A histogram is used for continuous variables like height, while a bar plot is used for categorical variables like favorite color.

No comments:

Post a Comment

Binomial Distribution in very simple words

The binomial distribution is a probability distribution that describes the outcome of a series of independent "yes/no" experiments...