Skip to content

Commit fed63d6

Browse files
standardize arg check
1 parent 75137ac commit fed63d6

File tree

1 file changed

+5
-5
lines changed
  • packages/python/plotly/plotly/express

1 file changed

+5
-5
lines changed

Diff for: packages/python/plotly/plotly/express/_core.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1984,7 +1984,7 @@ def make_figure(args, constructor, trace_patch=None, layout_patch=None):
19841984
row = m.val_map[val]
19851985
else:
19861986
if (
1987-
bool(args.get("marginal_x", False)) # there is a marginal
1987+
args.get("marginal_x", None) is not None # there is a marginal
19881988
and trace_spec.marginal != "x" # and we're not it
19891989
):
19901990
row = 2
@@ -2068,10 +2068,10 @@ def make_figure(args, constructor, trace_patch=None, layout_patch=None):
20682068
nrows = math.ceil(ncols / facet_col_wrap)
20692069
ncols = min(ncols, facet_col_wrap)
20702070

2071-
if args.get("marginal_x"):
2071+
if args.get("marginal_x", None) is not None:
20722072
nrows += 1
20732073

2074-
if args.get("marginal_y"):
2074+
if args.get("marginal_y", None) is not None:
20752075
ncols += 1
20762076

20772077
fig = init_figure(
@@ -2118,7 +2118,7 @@ def init_figure(args, subplot_type, frame_list, nrows, ncols, col_labels, row_la
21182118

21192119
# Build column_widths/row_heights
21202120
if subplot_type == "xy":
2121-
if bool(args.get("marginal_x", False)):
2121+
if args.get("marginal_x", None) is not None:
21222122
if args["marginal_x"] == "histogram" or ("color" in args and args["color"]):
21232123
main_size = 0.74
21242124
else:
@@ -2131,7 +2131,7 @@ def init_figure(args, subplot_type, frame_list, nrows, ncols, col_labels, row_la
21312131
else:
21322132
vertical_spacing = args.get("facet_row_spacing", None) or 0.03
21332133

2134-
if bool(args.get("marginal_y", False)):
2134+
if args.get("marginal_y", None) is not None:
21352135
if args["marginal_y"] == "histogram" or ("color" in args and args["color"]):
21362136
main_size = 0.74
21372137
else:

0 commit comments

Comments
 (0)