Add option to normalise histogram charts

Issue #1008 new
David Platten created an issue

This can be achieved by changing the following line in chart_fuctions.py:

histogram_data = np.histogram(
    category_subset[params["df_value_col"]].values, bins=bins
)

to:

histogram_data = np.histogram(
    category_subset[params["df_value_col"]].values, bins=bins, density=True,
)

See: https://numpy.org/doc/stable/reference/generated/numpy.histogram.html

Will also need to:

  • add a chart option (boolean) to switch the normalisation on or off
  • change the y-axis label from “Frequency” to “Probability density” when normalisation is switched on.

Comments (1)

  1. Log in to comment