Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit 5e2a4ed

Browse files
closes #91
1 parent 5375ffc commit 5e2a4ed

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: plotly_express/_core.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ def make_trace_kwargs(args, trace_spec, g, mapping_labels, sizeref):
188188
result["marker"]["sizemode"] = "area"
189189
result["marker"]["sizeref"] = sizeref
190190
mapping_labels[v_label] = "%{marker.size}"
191+
elif k == "marginal_x":
192+
if trace_spec.constructor == go.Histogram:
193+
mapping_labels["count"] = "%{y}"
194+
elif k == "marginal_y":
195+
if trace_spec.constructor == go.Histogram:
196+
mapping_labels["count"] = "%{x}"
191197
elif k == "trendline":
192198
if v in ["ols", "lowess"] and args["x"] and args["y"] and len(g) > 1:
193199
import statsmodels.api as sm
@@ -556,7 +562,7 @@ def make_trace_spec(args, constructor, attrs, trace_patch):
556562
if args["marginal_" + letter] == "histogram":
557563
trace_spec = TraceSpec(
558564
constructor=go.Histogram,
559-
attrs=[letter],
565+
attrs=[letter, "marginal_" + letter],
560566
trace_patch=dict(opacity=0.5, bingroup=letter, **axis_map),
561567
)
562568
elif args["marginal_" + letter] == "violin":

0 commit comments

Comments
 (0)