Histogram
What is a histogram?
A histogram is a graphical display that shows the distribution of numerical data by grouping values into contiguous intervals (bins) and representing the frequency (or proportion/density) of observations in each bin with a bar. It condenses many data points into an easily interpreted visual that reveals patterns such as skewness, modality, and spread.
Key points:
* Horizontal axis (x): value intervals (bins).
* Vertical axis (y): frequency, percentage, or density for each bin.
* Bars are contiguous (no gaps) because bins represent continuous ranges.
* Useful for visualizing distribution shape, outliers, and central tendency.
Explore More Resources
How histograms work
- Choose bin boundaries and widths (equal-width bins are common, but variable widths are possible).
- Count how many observations fall into each bin.
- Draw a bar for each bin whose height reflects the chosen metric (count, percentage, or density).
- Interpret the overall shape (e.g., symmetric, skewed left/right, unimodal, multimodal).
Customization options:
* Bin count/width — more bins show more detail; fewer bins smooth noise.
* Y-axis metric — raw frequency, percentage of total, or probability density (area proportional to probability).
* Axis labels and scales — linear or log scales depending on data.
Histograms vs. bar charts
Although visually similar, they serve different purposes:
* Histogram: for continuous numerical data; bins are adjacent; bar width conveys interval size; area or height represents frequency/density.
* Bar chart: for discrete or categorical data; bars usually separated by gaps; bar height alone carries meaning; width is arbitrary.
Explore More Resources
How to make a histogram
Manual steps:
1. Determine the data range and choose bin boundaries (equal-length intervals recommended).
2. Count observations in each bin (frequency).
3. Label the x-axis with bin ranges and the y-axis with frequency/percentage/density.
4. Draw contiguous bars covering each bin with heights equal to the frequencies.
Using software:
* Most spreadsheet and statistical programs (e.g., Excel, R, Python libraries) provide histogram tools where you can specify bin count or boundaries and select frequency vs. density output.
Explore More Resources
Example: the MACD histogram (technical analysis)
The MACD histogram is a specialized histogram used in technical trading. It displays the difference between the MACD line and the signal line:
* Positive bar: MACD line is above the signal line (bullish momentum).
* Negative bar: MACD line is below the signal line (bearish momentum).
* Increasing bar height away from zero indicates strengthening momentum; decreasing height toward zero suggests weakening momentum.
Trading notes:
* The MACD histogram can give earlier visual signals of momentum changes than the MACD and signal lines themselves because it highlights the rate of change between them.
* Traders often watch for shortening bars (a bar smaller than the previous) as an early warning of a momentum shift.
* Use the MACD histogram with other indicators and risk management (for example, stop-loss orders) to reduce false signals.
Explore More Resources
When to use a histogram
Use a histogram when you need to:
* Visualize the distribution of continuous numerical data.
* Detect skewness, modality, or outliers.
* Compare distributions across groups (use side-by-side histograms or density overlays).
* Inform decisions that depend on understanding frequency over ranges (quality control, demographics, performance metrics).
Bottom line
A histogram is a simple, effective way to summarize and visualize the distribution of numerical data by grouping values into bins and plotting their frequencies or densities. Proper bin selection and interpretation reveal important features of the data that support analysis and decision-making. In specialized contexts—such as the MACD histogram in trading—histograms can also reveal changes in momentum and provide earlier visual cues than the underlying averaged lines.