# What is a histogram?

What is a bar chart? What is a histogram? These are a diagrammatic representation of data. The use of tabular data and graphs and charts makes it easy to understand the concept of bar charts and histograms. In this lesson, we will learn definitions and examples on how to draw a bar chart and a histogram.

## Suggested Videos

### Diagrammatic Representation of Data

Data can be presented in the form of organized information, combined in tables or even graphically represented. Imagine seeing a set of data in the written form or in tabular form versus a graph that gives you the same information. Isn’t it simpler and quicker to comprehend data if we can visually see it?

It is for this purpose that data can be organized graphically for interpretation in a single glance in Statistics. The two forms of graphical representation that we shall cover in this lesson are bar diagram and histogram.

Download the Cheat Sheet of Statistics by clicking on the button below  ### Bar Diagram

Also known as a column graph, a bar graph or a bar diagram is a pictorial representation of data. It is shown in the form of rectangles spaced out with equal spaces between them and having equal width. The equal width and equal space criteria are important characteristics of a bar graph.

Note that the height (or length) of each bar corresponds to the frequency of a particular observation. You can draw bar graphs both, vertically or horizontally depending on whether you take the frequency along the vertical or horizontal axes respectively. Let us take an example to understand how a bar graph is drawn.

 Sports No. of Students Basketball 15 Volleyball 25 Football 10 Total 50

The above table depicts the number of students of a class engaged in any one of the three sports given. Note that the number of students is actually the frequency. So, if we take frequency to be represented on the y-axis and the sports on the x-axis, taking each unit on the y-axis to be equal to 5 students, we would get a graph that resembles the one below.

The blue rectangles here are called bars. Note that the bars have equal width and are equally spaced, as mentioned above. This is a simple bar diagram.

## Histogram

For the histogram used in digital image processing, see Image histogram and Color histogram.
HistogramOne of the Seven Basic Tools of QualityFirst described byKarl PearsonPurposeTo roughly assess the probability distribution of a given variable by depicting the frequencies of observations occurring in certain ranges of values.

A histogram is an approximate representation of the distribution of numerical or categorical data. It was first introduced by Karl Pearson. To construct a histogram, the first step is to “bin” (or “bucket”) the range of values—that is, divide the entire range of values into a series of intervals—and then count how many values fall into each interval. The bins are usually specified as consecutive, non-overlapping intervals of a variable. The bins (intervals) must be adjacent, and are often (but not required to be) of equal size.

If the bins are of equal size, a rectangle is erected over the bin with height proportional to the frequency—the number of cases in each bin. A histogram may also be normalized to display “relative” frequencies. It then shows the proportion of cases that fall into each of several categories, with the sum of the heights equaling 1.

However, bins need not be of equal width; in that case, the erected rectangle is defined to have its area proportional to the frequency of cases in the bin. The vertical axis is then not the frequency but frequency density—the number of cases per unit of the variable on the horizontal axis. Examples of variable bin width are displayed on Census bureau data below.

As the adjacent bins leave no gaps, the rectangles of a histogram touch each other to indicate that the original variable is continuous.

Histograms give a rough sense of the density of the underlying distribution of the data, and often for density estimation: estimating the probability density function of the underlying variable.

The total area of a histogram used for probability density is always normalized to 1.

If the length of the intervals on the x-axis are all 1, then a histogram is identical to a relative frequency plot.

A histogram can be thought of as a simplistic kernel density estimation, which uses a kernel to smooth frequencies over the bins. This yields a smoother probability density function, which will in general more accurately reflect distribution of the underlying variable.

The density estimate could be plotted as an alternative to the histogram, and is usually drawn as a curve rather than a set of boxes. Histograms are nevertheless preferred in applications, when their statistical properties need to be modeled.

The correlated variation of a kernel density estimate is very difficult to describe mathematically, while it is simple for a histogram where each bin varies independently.

An alternative to kernel density estimation is the average shifted histogram,
which is fast to compute and gives a smooth curve estimate of the density without using kernels.

The histogram is one of the seven basic tools of quality control.

Histograms are sometimes confused with bar charts. A histogram is used for continuous data, where the bins represent ranges of data, while a bar chart is a plot of categorical variables. Some authors recommend that bar charts have gaps between the rectangles to clarify the distinction.

### Examples

This is the data for the histogram to the right, using 500 items:

Bin
Count
−3.5 to −2.51 9
−2.5 to −1.51 32
−1.5 to −0.51 109
−0.5 to 0.49 180
0.5 to 1.49 132
1.5 to 2.49 34
2.5 to 3.49 4

The words used to describe the patterns in a histogram are: “symmetric”, “skewed left” or “right”, “unimodal”, “bimodal” or “multimodal”.

• Symmetric, unimodal

• Skewed right

• Skewed left

• Bimodal

• Multimodal

• Symmetric

It is a good idea to plot the data using several different bin widths to learn more about it. Here is an example on tips given in a restaurant.

• Tips using a \$1 bin width, skewed right, unimodal

• Tips using a 10c bin width, still skewed right, multimodal with modes at \$ and 50c amounts, indicates rounding, also some outliers

## What is histogram? – Definition from WhatIs.com

### SearchCloudComputing

• Don't limit your cloud services to just what your provider offers. Consider these third-party alternatives to handle images, …
• As application front ends move to the cloud, it's important for app designers and cloud users to understand how serverless and …
• Customers who buy software from ISVs through AWS Marketplace now have an easier way to update contract terms during the span of …

### SearchAppArchitecture

• You've deployed your application, now what? To keep your application performing well, you need to track various metrics. Take a …
• Why bother with behavior-driven development? Learn how this Agile-focused development framework can help bolster application …
• Applications change, and the APIs they depend on need to be updated and upgraded accordingly. Developers who know the value of …

### SearchITOperations

• Container vulnerabilities open the door to security issues and cascading failures across an IT environment. Use this Clair …
• As IT infrastructures become more complex, and development cycles more rapid, organizations increasingly lean on automation — …
• ServiceNow continues to direct its workflows toward vertical markets with new offerings for telecommunications, financial …
• Dojo Toolkit version 7 is now available. The widely used, mature JavaScript framework favored by enterprise shops gains more …
• JFrog Shippable aims to simplify pipeline management. JFrog VP of Engineering Avi Cavale discusses strategies to implement DevOps…
• With Quarkus, Red Hat targets the popular Spring Boot framework to help developers use Java as a first-class language to build …

### SearchAWS

• Amazon has set a standard for workplace innovation that many firms aim to emulate. But experts advise executives to adjust …
• Scan this overview of Amazon's various retail business units, from online platforms to brick-and-mortar stores, to understand …
• Amazon confronts cloud rivals with microprocessor designs. AWS ARM-based A1 instances offer high processing for lower costs and …

## Histogram Definition

A histogram is a graphical representation that organizes a group of data points into user-specified ranges. It is similar in appearance to a bar graph. The histogram condenses a data series into an easily interpreted visual by taking many data points and grouping them into logical ranges or bins.

• A histogram is a bar graph-like representation of data that buckets a range of outcomes into columns along the x-axis.
• The y-axis represents the number count or percentage of occurrences in the data for each column and can be used to visualize data distributions.
• In trading, the MACD histogram is used by technical analysts to indicate changes in momentum.

Image by Julie Bang © Investopedia 2019

Histograms are commonly used in statistics to demonstrate how many of a certain type of variable occurs within a specific range. For example, a census focused on the demography of a country may use a histogram to show how many people are between the ages of 0 and 10, 11 and 20, 21 and 30, 31 and 40, 41 and 50, etc. This histogram would look similar to the example above.

Many traders are familiar with the moving average convergence divergence (MACD) histogram, which is a popular technical indicator that illustrates the difference between the MACD line and the signal line.

For example, if there is a \$5 difference between the two lines, the MACD histogram graphically represents this difference. The MACD histogram is plotted on a chart to make it easy for a trader to determine a specific security’s momentum.

A histogram bar is positive when the MACD line is above the signal line, and negative when the MACD line is below the signal line. An increasing MACD histogram indicates an increase in upward momentum, while a decreasing histogram is used to signal downward momentum.

Traders often overlook the MACD histogram when using this indicator to make trading decisions.

A weakness of using the MACD indicator in its traditional sense, when the MACD line crosses over the signal line, is that the trading signal lags price.

Because the two lines are moving averages, they do not cross until a price move has already occurred. This means that traders forego a portion of this initial move.

The MACD histogram helps to alleviate this problem by generating earlier entry signals. Traders can track the length of the histogram bars as they move away from the zero line. The indicator generates a trading signal when a histogram bar is shorter in length than the preceding bar.

Once the smaller histogram bar completes, traders open a position in the direction of the histogram’s decline. Other technical indicators should be used in conjunction with the MACD histogram to increase the signal’s reliability.

Traders should place a stop-loss order to close the trade if the security’s price does not move as anticipated.

## What Is a Histogram and How Is This Graph Used in Statistics?

A histogram is a type of graph that has wide applications in statistics. Histograms provide a visual interpretation of numerical data by indicating the number of data points that lie within a range of values.

These ranges of values are called classes or bins. The frequency of the data that falls in each class is depicted by the use of a bar. The higher that the bar is, the greater the frequency of data values in that bin.

At first glance, histograms look very similar to bar graphs. Both graphs employ vertical bars to represent data. The height of a bar corresponds to the relative frequency of the amount of data in the class.

The higher the bar, the higher the frequency of the data. The lower the bar, the lower the frequency of data. But looks can be deceiving. It is here that the similarities end between the two kinds of graphs.

The reason that these kinds of graphs are different has to do with the level of measurement of the data. On one hand, bar graphs are used for data at the nominal level of measurement.

Bar graphs measure the frequency of categorical data, and the classes for a bar graph are these categories. On the other hand, histograms are used for data that is at least at the ordinal level of measurement.

The classes for a histogram are ranges of values.

Another key difference between bar graphs and histograms has to do with the ordering of the bars. In a bar graph, it is common practice to rearrange the bars in order of decreasing height. However, the bars in a histogram cannot be rearranged. They must be displayed in the order that the classes occur.

The diagram above shows us a histogram. Suppose that four coins are flipped and the results are recorded.

The use of the appropriate binomial distribution table or straightforward calculations with the binomial formula shows the probability that no heads are showing is 1/16, the probability that one head is showing is 4/16.

The probability of two heads is 6/16. The probability of three heads is 4/16. The probability of four heads is 1/16.

We construct a total of five classes, each of width one. These classes correspond to the number of heads possible: zero, one, two, three or four. Above each class, we draw a vertical bar or rectangle. The heights of these bars correspond to the probabilities mentioned for our probability experiment of flipping four coins and counting the heads.

The above example not only demonstrates the construction of a histogram, but it also shows that discrete probability distributions can be represented with a histogram. Indeed, and discrete probability distribution can be represented by a histogram.

To construct a histogram that represents a probability distribution, we begin by selecting the classes. These should be the outcomes of a probability experiment.

The width of each of these classes should be one unit. The heights of the bars of the histogram are the probabilities for each of the outcomes.

With a histogram constructed in such a way, the areas of the bars are also probabilities.

Since this sort of histogram gives us probabilities, it is subject to a couple of conditions. One stipulation is that only nonnegative numbers can be used for the scale that gives us the height of a given bar of the histogram. A second condition is that since the probability is equal to the area, all of the areas of the bars must add up to a total of one, equivalent to 100%.

The bars in a histogram do not need to be probabilities. Histograms are helpful in areas other than probability. Anytime that we wish to compare the frequency of occurrence of quantitative data a histogram can be used to depict our data set.