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

Commit 60a9e91

Browse files
fix histogram marginal plots for contours
1 parent 02e554d commit 60a9e91

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

plotly_express/_core.py

+12-5
Original file line numberDiff line numberDiff line change
@@ -732,14 +732,21 @@ def make_figure(args, constructor, trace_patch={}, layout_patch={}):
732732
m.updater(trace, m.val_map[val])
733733
except ValueError:
734734
if (
735-
len(trace_specs) == 1
736-
or trace_specs[0].constructor not in [go.Scatter, go.Scattergl]
737-
or m.variable != "symbol"
735+
trace_spec != trace_specs[0]
736+
and trace_spec.constructor in [go.Violin, go.Box, go.Histogram]
737+
and m.variable == "symbol"
738738
):
739+
pass
740+
elif (
741+
trace_spec != trace_specs[0]
742+
and trace_spec.constructor in [go.Histogram]
743+
and m.variable == "color"
744+
):
745+
trace.update(marker=dict(color=m.val_map[val]))
746+
else:
739747
raise
740748
if (
741-
len(trace_specs) != 1
742-
and trace_specs[0].constructor == go.Histogram2dContour
749+
trace_specs[0].constructor == go.Histogram2dContour
743750
and trace_spec.constructor == go.Box
744751
and trace.line.color
745752
):

0 commit comments

Comments
 (0)