Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fccdfea

Browse filesBrowse files
wip
1 parent b666924 commit fccdfea
Copy full SHA for fccdfea

File tree

Expand file treeCollapse file tree

1 file changed

+8
-2
lines changed
Filter options
  • packages/python/plotly/plotly/express
Expand file treeCollapse file tree

1 file changed

+8
-2
lines changed

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

Copy file name to clipboardExpand all lines: packages/python/plotly/plotly/express/_core.py
+8-2Lines changed: 8 additions & 2 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.