Understanding nBins in requesting histograms API


I am trying to understand the meaning of nBins in requesting histograms from the statistical API.
The relevant doc I found is here..
It says: number of bins nBins.

Let’s say the min value (for the histogram) is 0.2 the max value is 0.8, and I specify nBins=7.
How is the width of each bin calculated? is it equal width, i.e., (max-min)/nBins? does it calculate the width of each bin so that each bin contains more or less the same number of values? it is something else?


There are 3 methods you can use to specify the bins used to generate a histogram.

You can specify:

  • the number of bins nBins or
  • the width of bins binWidthor
  • arbitrary bins.

There are examples on how the different options can be implemented here. I think that this information should help answer your question.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.