Accendo Reliability

Your Reliability Engineering Professional Development Site

  • Home
  • About
    • Contributors
    • About Us
    • Colophon
    • Survey
  • Reliability.fm
  • Articles
    • CRE Preparation Notes
    • NoMTBF
    • on Leadership & Career
      • Advanced Engineering Culture
      • ASQR&R
      • Engineering Leadership
      • Managing in the 2000s
      • Product Development and Process Improvement
    • on Maintenance Reliability
      • Aasan Asset Management
      • AI & Predictive Maintenance
      • Asset Management in the Mining Industry
      • CMMS and Maintenance Management
      • CMMS and Reliability
      • Conscious Asset
      • EAM & CMMS
      • Everyday RCM
      • History of Maintenance Management
      • Life Cycle Asset Management
      • Maintenance and Reliability
      • Maintenance Management
      • Plant Maintenance
      • Process Plant Reliability Engineering
      • RCM Blitz®
      • ReliabilityXperience
      • Rob’s Reliability Project
      • The Intelligent Transformer Blog
      • The People Side of Maintenance
      • The Reliability Mindset
    • on Product Reliability
      • Accelerated Reliability
      • Achieving the Benefits of Reliability
      • Apex Ridge
      • Field Reliability Data Analysis
      • Metals Engineering and Product Reliability
      • Musings on Reliability and Maintenance Topics
      • Product Validation
      • Reliability by Design
      • Reliability Competence
      • Reliability Engineering Insights
      • Reliability in Emerging Technology
      • Reliability Knowledge
    • on Risk & Safety
      • CERM® Risk Insights
      • Equipment Risk and Reliability in Downhole Applications
      • Operational Risk Process Safety
    • on Systems Thinking
      • Communicating with FINESSE
      • The RCA
    • on Tools & Techniques
      • Big Data & Analytics
      • Experimental Design for NPD
      • Innovative Thinking in Reliability and Durability
      • Inside and Beyond HALT
      • Inside FMEA
      • Institute of Quality & Reliability
      • Integral Concepts
      • Learning from Failures
      • Progress in Field Reliability?
      • R for Engineering
      • Reliability Engineering Using Python
      • Reliability Reflections
      • Statistical Methods for Failure-Time Data
      • Testing 1 2 3
      • The Manufacturing Academy
  • eBooks
  • Resources
    • Accendo Authors
    • FMEA Resources
    • Glossary
    • Feed Forward Publications
    • Openings
    • Books
    • Webinar Sources
    • Podcasts
  • Courses
    • Your Courses
    • Live Courses
      • Introduction to Reliability Engineering & Accelerated Testings Course Landing Page
      • Advanced Accelerated Testing Course Landing Page
    • Integral Concepts Courses
      • Reliability Analysis Methods Course Landing Page
      • Applied Reliability Analysis Course Landing Page
      • Statistics, Hypothesis Testing, & Regression Modeling Course Landing Page
      • Measurement System Assessment Course Landing Page
      • SPC & Process Capability Course Landing Page
      • Design of Experiments Course Landing Page
    • The Manufacturing Academy Courses
      • An Introduction to Reliability Engineering
      • Reliability Engineering Statistics
      • An Introduction to Quality Engineering
      • Quality Engineering Statistics
      • FMEA in Practice
      • Process Capability Analysis course
      • Root Cause Analysis and the 8D Corrective Action Process course
      • Return on Investment online course
    • Industrial Metallurgist Courses
    • FMEA courses Powered by The Luminous Group
    • Foundations of RCM online course
    • Reliability Engineering for Heavy Industry
    • How to be an Online Student
    • Quondam Courses
  • Calendar
    • Call for Papers Listing
    • Upcoming Webinars
    • Webinar Calendar
  • Login
    • Member Home
  • Barringer Process Reliability Introduction Course Landing Page
  • Upcoming Live Events
You are here: Home / Articles / Creating a Histogram

by Fred Schenkelberg Leave a Comment

Creating a Histogram

Creating a Histogram

A histogram is a graphical representation of a set of data. It is useful to visually inspect data for its range, distribution, location, scale, skewness, etc. There are many uses for histogram, there you should know how to create one.

Let’s explore a set of data and create default histograms using a variety of methods. If you have a way to create a histogram using some other method or software package please send it over and we’ll add it to the article.

The Data

This is just completely made up data set.

5, 7, 3, 4, 3, 6, 9, 2, 4, 3, 6, 9, 1, 3, 4, 7, 4, 5, 4, 3

The values range from a low of 1 and a high of 9. All integers.

A Manually Created Histogram

Draw and label the x and y axis of the chart. For the x-axis a span from zero to ten will encompass all the values in the dataset. For the y-axis, we can include integers starting at zero and we could go up to 20, given that is the number of values in the dataset, yet not all values are the same, so let’s start with zero to ten.

The x-axis is our values (test scores, plant heights rounded to centimeters, whatever the dataset represents). The y-axis is the count of values within the specific bin.

Determine the bin size is a bit of a flexible process. In part it depends on what you want to learn about your data. If we want to know how many or each integer, then each bin is one integer. If the data included more significant digits we could specify the bin as a range. For example, for the above dataset, we could use bins of 0 to 1, > 1 to 2, > 2 to 3, etc. I’m using greater than signs to indicate if the value is just above 1 in the number line(1.0001, for example), we would count that value in the bin that ranges from >1 to 2. A value of 1 exactly would belong to the bin ranging from zero to 1.

Note bin sizes do not need to be equal, yet it helps interpret a histogram if they are all the same size. One fancy way to determine bin sizes is known as Sturge’s Rule and may provide a good bin size when dealing with larger dataset or as a starting point for exploring your data.

Let’s use 5 bins: 0 – 1, >1 – 3, >3 – 5, >5 – 7, >7 – 9.

With our bins established, we simply count the number of values that fall within each bin. We can create a frequency table to layout the count of values within each bin.

Bin Count
1 1
3 6
5 7
7 4
9 2

Between zero and one, there is only one value of 1, thus the bin’s count is one. There are a count of six values that are a 2 or 3, and so on.

Now draw a rectangle over the bin range up to the count.

Here’s my rough hand-drawn histogram.

Maybe I should have selected even numbers for the bins to keep the bin widths the same. Maybe you can create one starting with the bin zero to two and send over a photo of it.

Excel for Mac (version 16 – current as of May 2021)

Added the data to a column in Excel and selected the dataset values. On the ribbon, click the Insert tab, then click the Statistical chart icon (Statistical icon) and under Histogram, select the Histogram.

And, Excel selected three bins and created the plot.

The bins are 2.8 units wide and range from 1 up to 9.4. Of course, you edit the titles, labels, and even the bin sizes

Google Sheets with XLMiner Analysis ToolPak (May 2021)

Wondering how Sheets would deal with this graphic, found that I needed to install an add-on to have histogram functionality. That didn’t take long, and added the dataset in a column, selected the data and opened the add-on, then found the Histogram function.

It asked for the range of the data, a range for the bin value (I used the same as my manual approach above), and where to locate the frequency table. It also created the graph.

A bit nicer then my hand drawn one, yet contains the same information.

R software (version 4.0.4)

The command hist has many options and ways to alter the final graphic, yet here let’s just use all defaults. The commend in R is:

hist(c(5, 7, 3, 4, 3, 6, 9, 2, 4, 3, 6, 9, 1, 3, 4, 7, 4, 5, 4, 3))

and the output is

It is a bit odd, as it seems to set the first bin to anything 2 or below, as there is a count of two for the 1’s and 2’s in the dataset. Then the bins shift to single integers, or >2 to 3, then >3 to 4, etc.

Mathematica (Mac version 12.2)

The built in command Histogram has a vast array of options to craft and format the histogram. Here again just using all defaults, expect I did add axis labels. The command I used is:

Histogram[{5, 7, 3, 4, 3, 6, 9, 2, 4, 3, 6, 9, 1, 3, 4, 7, 4, 5, 4,3}, AxesLabel -> {"Values", "Count"}]

and the output then appears as

Cool, the package choose the bins in groups of two, from 0 to 2, >2 to 4, etc.

Summary

Here are five ways to create a histogram of the same dataset. Note how different each resulting histogram appears based on how the bins were assigned. When using histograms, I often alter the bins a few times to explore the dataset. Of course, with ample data each of the above methods would likely create a very similar looking histogram.

Finally, if you have Minitab, Numbers, Item Software, Matlab, or one of the many other software packages out there, please use the dataset above and create a histogram. Send me a brief description and the resulting graphic, include the software name and version, brief description of how to create a histogram, and the resulting image of the histogram. I’ll add them to the article above and with your permission include attribution to you for your contribution.

Filed Under: Articles, CRE Preparation Notes, Probability and Statistics for Reliability

About Fred Schenkelberg

I am the reliability expert at FMS Reliability, a reliability engineering and management consulting firm I founded in 2004. I left Hewlett Packard (HP)’s Reliability Team, where I helped create a culture of reliability across the corporation, to assist other organizations.

« How Can You Estimate Reliability Without Life Data?
How is Formal Experimentation different from Simplistic Approaches (Part I) »

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

CRE Preparation Notes

Article by Fred Schenkelberg

Join Accendo

Join our members-only community for full access to exclusive eBooks, webinars, training, and more.

It’s free and only takes a minute.

Get Full Site Access

Not ready to join?
Stay current on new articles, podcasts, webinars, courses and more added to the Accendo Reliability website each week.
No membership required to subscribe.

[popup type="" link_text="Get Weekly Email Updates" link_class="button" ][display_form id=266][/popup]

  • CRE Preparation Notes
  • CRE Prep
  • Reliability Management
  • Probability and Statistics for Reliability
  • Reliability in Design and Development
  • Reliability Modeling and Predictions
  • Reliability Testing
  • Maintainability and Availability
  • Data Collection and Use

© 2025 FMS Reliability · Privacy Policy · Terms of Service · Cookies Policy