When I use px.histogram with a histnorm
parameter set to percent
or probability
, but I also use color
, the graph looks incorrect, with percentage above 100%.
It seems that the probability is only calculated for that given bin for values that are in the given set of values delimited by the color.
additional_params = dict(
color='prewarmed',
pattern_shape='prewarmed_slot',
category_orders=dict(
prewarmed=[True, False],
prewarmed_slot=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, "None", None])
)
fig = px.histogram(df,
x='queued_duration',
histnorm='percent',
**additional_params)
This seems to be in contradiction with the definition (from the documentation):
If `'percent'` , the output of `histfunc` for a given bin is divided by the sum of the output of `histfunc` for all bins and multiplied by 100
.
There is no mention of color
or any other parameter affecting that calculation.
Is there a way to ensure that colors can be used together with a meaningful βall-dataβ histnorm?
Also, does anyone know why the pattern_shape
is not working? Iβm using Plotly 5.10