iwfm.plot.overlay_histograms

iwfm.plot.overlay_histograms(data1, data2, file_name, label1='Data 1', label2='Data 2', format='pdf', alpha=0.5, bins='auto')[source]

Overlay two histograms to visualize the distribution of two datasets.

Parameters:
  • data1 (list or array-like) – The first dataset.

  • data2 (list or array-like) – The second dataset.

  • label1 (str, optional) – Label for the first dataset.

  • label2 (str, optional) – Label for the second dataset.

  • format (str, optional, default = 'pdf') – output file format: eps, jpeg, jpg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff, webp

  • alpha (float, optional, default = 0.5) – Transparency level for histograms. Value ranges from 0 (completely transparent) to 1 (fully opaque).

  • bins (int or str, optional, default = 'auto') – Number of bins for the histograms. Can be an integer specifying the number of bins, or a method like ‘auto’ to automatically determine the number of bins.

Return type:

None

Example

overlay_histograms(data1, data2, label1=’Dataset 1’, label2=’Dataset 2’, alpha=0.5, bins=’auto’)