# How can the bin width be set for a histogram where the “Probability” option is used? [closed]

How can a histogram be created when the "Probability" option is used, and a specified bin width is needed?

In the example below, I am trying to set the bin width to 1, but Mathematica throws an error:

 Histogram[data, Automatic, "Probability", {1}]


## closed as off-topic by corey979, JimB, m_goldberg, MarcoB, EdmundSep 15 at 10:26

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – corey979, JimB, m_goldberg, MarcoB, Edmund
If this question can be reworded to fit the rules in the help center, please edit the question.

• Try "PDF"...... – OkkesDulgerci Sep 11 at 11:50
• I thought PDF was exclusively for situations where the distribution is known. I am using data... – user120911 Sep 11 at 12:01
• The docs say Histogram[data,bspec,hspec], where bspec is the bin width specification, and hspec – bin height. – corey979 Sep 11 at 12:24
• The histogram is a bit outdated. Try SmoothHistogram or SmoothKernelDistribution. – JimB Sep 11 at 16:01

Histogram[data, {x}, "Probability"]; x is your bin size.