Skip to content

Commit fccdfea

Browse files
wip
1 parent b666924 commit fccdfea

File tree

1 file changed

+8
-2
lines changed
  • packages/python/plotly/plotly/express

1 file changed

+8
-2
lines changed

packages/python/plotly/plotly/express/_core.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -1813,6 +1813,14 @@ def infer_config(args, constructor, trace_patch, layout_patch):
18131813
):
18141814
args["facet_col_wrap"] = 0
18151815

1816+
if "norm" in args:
1817+
if args.get("norm", None) not in [None, "percent", "probability"]:
1818+
raise ValueError(
1819+
"`norm` must be one of None, 'percent' or 'probability'. "
1820+
+ "'%s' was provided." % args["norm"]
1821+
)
1822+
args["histnorm"] = args["norm"]
1823+
18161824
# Compute applicable grouping attributes
18171825
for k in group_attrables:
18181826
if k in args:
@@ -2040,8 +2048,6 @@ def make_figure(args, constructor, trace_patch=None, layout_patch=None):
20402048
group[var] = group[var] / group_sum
20412049
elif args["norm"] == "percent":
20422050
group[var] = 100.0 * group[var] / group_sum
2043-
args["histnorm"] = args["norm"]
2044-
# TODO norm, including histnorm-like naming
20452051

20462052
patch, fit_results = make_trace_kwargs(
20472053
args, trace_spec, group, mapping_labels.copy(), sizeref

0 commit comments

Comments
 (0)