Bar Graph and Histogram


In this blog, we will cover two more graphs in matplotlib i.e, Bar graphs and matplotlib. As many of us have confusion between Bar graph and histogram as both displays the count of values. Let’s see the difference and explore these graphs with the help of dataset of prices of car with other attributes also.

Bar Graph

Bar graph shows the count of each category present in the column(dataset). It mainly works fine for categorical value. With the help of graphs will see how it will not work fine for continuous values.


Histogram also shows the count of values but it work fine for continuous values like in our case, prices of cars. The histogram has bins which are from this value to this value particularly the range of  each bin. It will be clear to you through examples.

Histogram and Bar Chart

We have used one dataset throughout the series of matplotlib that is of Automobiles/Cars attributes and prices dataset. We have done some pre-processing in the dataset before being used for plotting. For that, you can refer to this blog.

Close Menu