iwfm.plot.histogram

iwfm.plot.histogram(data, name, unit, file, method='auto')[source]

Create a histogram of given data and determine the number of bins.

Parameters:
  • data (list or array-like) – The dataset for which the histogram is to be created.

  • method (str, optional) – Method for determining the number of bins. Options include: - ‘auto’: Automatically select an appropriate number of bins (default). - ‘sturges’: Use Sturges’ rule to determine the number of bins. - ‘sqrt’: Use the square root rule to determine the number of bins. - ‘rice’: Use Rice’s rule to determine the number of bins. - ‘scott’: Use Scott’s rule to determine the number of bins. - ‘fd’: Use the Freedman-Diaconis rule to determine the number of bins.

Returns:

  • histogram (array) – The histogram values, representing the frequency of data in each bin.

  • bins (int) – The determined number of bins for the histogram.