Bar Chart Vs. Histogram: Which Should You Choose?

Building a dashboard for visualizing data may seem straightforward until you try to do it yourself with a new dataset.

When you sit down to build a dashboard, selecting how you want to visually present that data creates real risks.

You'll add valuable information to your data when you select the best representation of that data.

If you don't, you'll create a negative impact on your audience's understanding of the information you are trying to convey.

The question about which type of chart to use and when to use it is a common debate among professionals and creates a great deal of confusion.

Although many analysts, marketers, and students use both bar charts and histograms, they tend to look and appear quite similar to one another.

Both have vertical columns for representing data in numerical form, and both charts typically have an x and y axis.

However, while bar charts and histograms may have a similar appearance to each other, they have very different purposes with regards to analysis.

When you select one type of chart and should have selected the other, you are changing the underlying statistical truth of the data you are representing.

Therefore, whether you are an analyst, a marketer, or a student completing a statistics project—knowing when to use each chart type will make your job easier.

Summary: How to determine which dhart to use

If you are trying to settle an argument about which type of chart to use, the most reliable method for determining which one to use is by looking at your x-axis.

The type of data you are showing on your x-axis will help you determine which type of chart to use.

Bar charts are used to compare individual or unique categories.

Vertical infographic comparing key features: intended use, data type, spacing, grouping, and arrangement.

Histograms are used to understand how continuous numerical data is distributed across the number line.

Feature
Bar Chart
Histogram
Intended Use
Compare different categories or groups of similar data
Show how data from a continuous type distributes
Type of Data on the X-Axis
Categorical Data (Countries, Product Lines, Months, etc.)
Continuous Numbers (Age, Income, Test Scores, Etc.)
Spacing Between Bars
There is a space between each of the individual bars
The Bars Touch One Another
Type of Grouping for Data
Individual Items (e.g. Discrete Items)
Bins/Intervals
Arrangement of Bars
The Bars Can Be Rearranged by Size
Order Is Strictly Numeric and Cannot be Rearranged

This comparison table captures what is described in the textbook definitions for these types of charts.

There are always exceptions to the rule when dealing with "real world" data analysis.

In order to create data visualizations that get people to make decisions, we must consider the mechanics behind each chart, consider the border line between chart types, and recognize the exact moment that a visualization becomes misleading.

Defining the competitors

In order to "Master Data Visualization," you will need to understand the components of the individual charts first before becoming a master of data visualization.

Each chart has its own purpose, and communicates differently because it is derived from a different mathematical foundation.

What is a bar chart?

A bar chart is a chart that consists of a series of rectangular bars representing categorical information.

The length or height (y) of each bar will be equal to the value (x) which the bar represents.

The various different categories of data may be interpreted as buckets of information that do not possess any numerical relationships between them, with examples of categories being Red, Blue and Green, or New York, London and Tokyo.

On a bar chart, the x-axis’ only purpose is to hold these different labels in place, while the y-axis indicates a count, total or average associated with that label.

The separation of categories causes the gaps in a bar chart between columns.

These separations are a deliberate visual representation to tell readers that these groups are exclusive from each other.

When going from one bar to the next, there is no flow of information from one bar to another, but rather a hard stop from one bar to another.

What is a histogram?

A histogram uses vertical columns as well as a different framework than bar charts to illustrate the distribution of continuous numeric data.

Data that is continuous represents an amount, with all values in a range being possible.

Examples of continuous data include time, weight, height, temperature, and investment returns.

In a histogram, the x-axis represents a continuous line of numbers. Data can be plotted on this number line by grouping it into non-overlapping intervals, or "bins."

The x-axis of a histogram is continuously scaled, which requires the columns to touch. There are no spaces between the columns.

The slots that connect indicate a key mathematical reality: that where one bin ends, precisely the next bin starts.

The curves made by these touching bars drive home the visual reminders of the distribution of data, allowing analysts to see the highest density of occurrences and how far out the data is, as well as whether there are any problematic outliers that skew the distribution.

Gaps and the difference between continuous data are concepts typically taught in a textbook setting.

Most data scientists working are more concerned about how the visual with which you present your data helps guide your audience's thinking.

When you show the audience a bar chart, you are inviting them to compare two things.

The primary comparison being made is between the sales for Q1 compared to the sales for Q2 or the effectiveness of Channel A vs. Channel B.

The eyes naturally move back and forth to see which column is the tallest and which is the shortest.

In presenting a histogram, however, you are inviting your audience to evaluate a shape.

While it might be easy for them to see and analyze the individual bins compared to one another, it is far more important for them to understand how all the individual items clustered together.

Does the distribution of ages look normal (bell-shaped)?

  • Is it skewed to the right because of extreme outliers and pulling the average higher?
  • Is it bimodal (two peaks) and therefore composed of two different populations?
  • The primary question answered by a bar chart would be, "Which was bigger?"
  • A histogram answers the question of "Where is the bulk of the data located?"

The same data visualized in two ways

The best way for you to understand the difference between these two visualizations is to see how they relate to the same dataset.

As an example, we will create a hypothetical company and say that an HR analyst has a table with the exact age of its 5,000 employees.

The HR analyst then wants to analyze this information to determine what type of healthcare benefits the company should offer its employees.

The histogram approach for detailed analysis

By creating a histogram, the HR analyst can determine a detailed picture of the age distribution of its workers.

1:1 infographic histogram visualizing workforce age distribution with integrated insights and an analyst.

On the x-axis of the chart was the bin width in intervals of 5 years, for example 20-25, 25-30, 30-35 etc.

On the y-axis of the chart is the number of employees that fall within the corresponding age group.

The bars in this chart are touching and have a distinctive visual appearance to them.

An analyst of the data may observe there being a large mass of employees in the range between 25 and 35 years old and a steep drop off from this point to the peak range of 55 to 60 years old.

This information shows a distributions pattern of a relatively young workforce and a small grouping of the approaching retirement group that can be used for very educated internal workforce planning considerations.

An alternative bar chart format for presentation purposes

During the same week, the same analyst presents the same demographic data to the marketing team for a presentation using a simple PowerPoint slide format.

The marketing team is not concerned with understanding the distribution of employees.

Rather, they are interested in using the demographic data to identify how many employees fit into three stealth swing generational categories that are typically used in the internal communication strategy for the company; specifically "Gen Z", "Millennials" and "Gen X".

The analyst takes the same spreadsheet of 5,000 age profiles, but now they create three separate categories using the same raw numbers and the analysts create a generic label above each of the categories.

In addition to the category name, the analyst will then produce a bar graph that graphically illustrates the following:

At the X-axis of the bar graph will contain three labels: "Gen Z", "Millennials", and "Gen X".

The bars are separated widely from one another.

The data shown in the chart indicated that the "Millennials" column is "double" the height of the "Gen Z" and "Gen X" columns.

In the previous example, the same analytical data was used to create a new analytical goal that is defined as comparing pre-defined categories of employees rather than looking for a continuous spread of data.

Borderline examples and difficult data

Life is never simple.

Most Data is Rarely Perfectly Labeled as 'Categorical' or 'Continuous' and as an Analyst, you will often have Areas Where the Regular Rules Do Not Apply.

Time-based data: Categories vs. ranges

Time-Based Data is perhaps the most common example of "Continuous" Data.

Time is flowing continuously - there are no "breaks" between seconds. Therefore, When Analyzing the Distribution of Events over Time, You Should Use a Histogram by Default.

However, for Reporting Purposes, Businesses Regularly Group Time into Hard Categories.

When Analysing the Distribution of Website Traffic over a Period of 24 Hours to Determine Peak Server Load, a Histogram Makes Sense: The x-axis Is a Continuous Clock and the Bars of The Histogram Touch Each Other, Which Represents the Increase in Traffic.

Then Again, When Analysing January, February, and March Sorted by Total Revenue, You Are Treating Time as a Category.

You Are No Longer Viewing the Continuous Flow of Time; Each "January", "February", And "March" is Treated as a Separate, Distinct Bucket.

A Standard Bar Chart with Gaps is the Correct Tool to Use Here.

Discrete numeric data

Many Dashboards Fail when It Comes to Discrete Numeric Data. What happens When You have a Discreet Piece of Numeric Data?

Let's Look at an Example: A Data Set of "Number of Children Per Household."

The Data Points Will Be 0, 1, 2, 3, 4; You Cannot Have 2.5 Children, As You Cannot Have a 'Half Child.' Therefore, All of the Data is Discrete.

Should You Use a Bar Chart for this Data because All the Numbers Act as Distinct Categories or a Histogram Because of the x-axis is Numeric?

Industry best practices often prescribe that discrete numeric data should be analyzed utilizing a histogram method for distributing numerical values.

However, when using histograms, a common source of inconsistency and confusion regarding the data arises from the application of strict binning rules.

Since the values are all whole numbers, each bin must be positioned directly on the whole number value.

As a result, while the underlying phenomenon that produces these values isn't technically a perfect continuous measurement, the analyst still wants to examine what type of distribution shape is present; what is its skewed nature; and what is the range from the minimum to maximum.

Data story mistakes

When a visual encoding is designed incorrectly, it not only appears unprofessional, but it also misrepresents the data, resulting in incorrect conclusions by decision makers.

Binning decisions

Histograms require analysts to determine how wide the intervals (bins) are to be.

The decision about bin widths is one of the most important in developing a valid narrative.

If the bins are too wide, the data becomes too smooth, causing the elimination of any detail and insight about key elements, peaks, and gaps within the dataset, because the individual points of data are lost within large, bulky bars.

For example, if an analyst sets a bin size of 30 days, an increase in churn for customer accounts on day 14 will not be seen because of the larger bin.

If, on the other hand, the bin sizes are set too narrow, the chart appears noisy and is not readable; fluctuations of small amounts create jagged peaks.

In this environment, the reader becomes confused by the excess of noise and misses the overall environmental trend.

Finding the correct bin sizes requires experimentation and an understanding of the question being asked in the current business environment.

What happens when you take continuous data and break it into categories

The most dangerous thing you can do when visualizing data is to take continuous data (data that is full of detail on a variety of points along a line) and force it into a bar chart using arbitrary categories.

Portrait diagram contrasting the mistake of categorizing continuous data vs. the correct method using continuous bins.

For example, let's say you have salary data that ranges from $40,000 to $250,000, and you decide to take that continuous data and make a bar chart by creating arbitrary categories called "low earners" and "mid earners" and "high earners."

By making these groups into categories with gaps between them, you are indicating that there is no relationship between those groups (which, in fact, there is) and breaking the visual connection (you also destroy any ability to see how the data is distributed within those categories).

You have no way of knowing whether all of the "high earners" are at about $105,000 or whether there are some who make $250,000 and some who make $40,000.

You don’t see the distribution of the data in a bar chart because of the way you have forced the data into the category format.

What happens when you use bar charts to show average

When doing comparisons using bar charts of the average value for each category, it is highly likely that extreme outlier values will skew the average and therefore significantly distort the true nature of the data.

Using an example of average customer spend for three different store locations, if there is a massive single purchase at store A by one individual, the average customer spend for store A will go up drastically because of that single purchase.

This will make the bar for store A tower over the other two stores.

Therefore, the stakeholders who see this will come to the conclusion that store A is doing exceptionally well in comparison to the other two stores.

However, if the analyst had created a histogram based on the transaction data from store A first, they would have seen the true nature of the distribution and the fact that the distribution was highly skewed because thousands of customers spent about $5 and only one person made a $50,000 purchase.

Bar charts do not provide this information to the user; a histogram does.

Street-smart decision guide for analysts

The easiest way to look at how to differentiate between a Bar Chart vs. a Histogram based on standard workflow examples is as follows:

The marketing campaign manager

If you were to use one of five different ad creatives to show the highest number of clicks in your campaign, the best choice would be a Bar Chart.

The type of data being compared is categorical (Ad A, Ad B, Ad C), and the ultimate goal is to compare each ad's performance.

Therefore, while building your Bar Chart you'll want to start with the largest bar and continue to build from there until you've reached the smallest bar.

This will allow your audience to immediately see which creative was the most successful.

The risk assessment officer

If you wanted to determine how long a mechanical part would last before failing, you would want to create a Histogram.

Mechanical Parts have a continuous (time/hours of operation) data type, and the main goal is to find out the probability of failure for the part.

Because Histograms contain touching bins, it is easy to see where the part will most likely fail.

The dashboard builder

If you were to receive thousands of customer satisfaction surveys, and wanted to see how often the customers ranked their experiences on a scale from 1 - 5, a Histogram (or a specialized variation such as a Discrete Frequency Plot) would provide the best option.

In this instance, creating a Bar Chart with an average score of 3.0 would mislead your audience by hiding the true nature of the scores (ie. Each customer rating their experience as a 3.0 is very different from half of the customers rating their experience as a 1.0 and half rating their experience as a 5.0).

Conclusion

Using the data dictates the outcome of the bar chart vs the histogram comparison.

Bar charts excel at displaying categorical data for comparison, as they visually separate categories and make size, volume, and ranking easy to discern at a glance.

Bar charts are straightforward and easy to read, making them ideal for executive summaries.

On the other hand, histograms are excellent for exploring the statistics of a dataset because they utilize the actual number line (continuous data) of the dataset to map out the complete view of the distribution, including peaks, valleys, clusters, and significant outliers that would be hidden by averages.

The x-axis will identify for you whether you have discrete categories, and therefore should have gaps between the bars, or if you have a continuous range of measurement, and therefore the bars should be touching, with the distribution being the answer.

Questions & answers

Why does a histogram not have any gaps between the bars?

Histograms do not have gaps between the bars because they represent the continuous number scale of the data.

The x-axis represents a continuous number, such as age, weight, time, etc.; therefore, the end of the first interval of data is the start of the next interval.

If there was a gap, this would mean that there are numbers between those intervals that are missing or otherwise unobtainable in continuous data.

Can numeric data be displayed using bars?

Yes, but yes should be limited to occasions in which the numbers act as labels or categories rather than as a continuous scale of measurement.

For example, you can use a bar chart to represent total sales from "Store 1," "Store 2," and "Store 3" because these numbers represent independent physical locations.

However, it would be inappropriate to use a bar chart to show the continuous distribution of salary.

How do I determine what width my bins should be?

No single correct width exists for your bins; however, most analysts will use formulas such as Square Root Choice, Sturges' formula, or the Freedman-Diaconis rule as guidelines.

The best way to determine bin size will be to through trial and error.

You should create enough bins to identify the genuine shape and underlying patterns within the sample distribution, without producing so many bins that the output chart appears as random jagged noise.

Are bar charts and histograms interchangeable?

Certainly not. Interchanging bar charts and histograms alters the essential value and message of the data represented.

By changing continuous measurements to random categories for purposes of creating a bar chart, you lose out on significant visualization elements, outliers, grouped figures, and distribution shape.

Conversely, plotting independent categories of data points (such as dog breeds) on a continuous sample histogram (x-axis) is mathematically impossible to interpret.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}