Skip to content

Commit 807b828

Browse files
wip
1 parent 538f18e commit 807b828

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,6 +1856,14 @@ def infer_config(args, constructor, trace_patch, layout_patch):
18561856
if "trendline_options" in args and args["trendline_options"] is None:
18571857
args["trendline_options"] = dict()
18581858

1859+
if "norm" in args:
1860+
if args.get("norm", None) not in [None, "percent", "probability"]:
1861+
raise ValueError(
1862+
"`norm` must be one of None, 'percent' or 'probability'. "
1863+
+ "'%s' was provided." % args["norm"]
1864+
)
1865+
args["histnorm"] = args["norm"]
1866+
18591867
# Compute applicable grouping attributes
18601868
for k in group_attrables:
18611869
if k in args:
@@ -2083,8 +2091,6 @@ def make_figure(args, constructor, trace_patch=None, layout_patch=None):
20832091
group[var] = group[var] / group_sum
20842092
elif args["norm"] == "percent":
20852093
group[var] = 100.0 * group[var] / group_sum
2086-
args["histnorm"] = args["norm"]
2087-
# TODO norm, including histnorm-like naming
20882094

20892095
patch, fit_results = make_trace_kwargs(
20902096
args, trace_spec, group, mapping_labels.copy(), sizeref

0 commit comments

Comments
 (0)