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

Commit 136a8de

Browse files
violin scalegroup tweaks
1 parent eca8e66 commit 136a8de

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

make_docs.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

33
set -e
4+
pip install -e .
45
jupyter nbconvert gallery.ipynb --execute --output-dir=docs --output=index --template=docs/nb.tpl
56
jupyter nbconvert walkthrough.ipynb --execute --output-dir=docs --template=docs/nb.tpl
67
pdoc plotly_express --html --html-dir=docs --overwrite --template-dir=docs/templates

plotly_express/_chart_types.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,12 @@ def violin(
272272
return make_figure(
273273
args=locals(),
274274
constructor=go.Violin,
275-
trace_patch=dict(orientation=orientation, points=points, box=dict(visible=box)),
275+
trace_patch=dict(
276+
orientation=orientation,
277+
points=points,
278+
box=dict(visible=box),
279+
scalegroup=True,
280+
),
276281
layout_patch=dict(violinmode="group"),
277282
)
278283

plotly_express/_core.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,9 @@ def make_trace_spec(args, constructor, attrs, trace_patch):
521521
)
522522
elif args["marginal_" + letter] == "violin":
523523
trace_spec = TraceSpec(
524-
constructor=go.Violin, attrs=[letter], trace_patch=axis_map
524+
constructor=go.Violin,
525+
attrs=[letter],
526+
trace_patch=dict(scalegroup=letter, **axis_map),
525527
)
526528
elif args["marginal_" + letter] == "box":
527529
trace_spec = TraceSpec(
@@ -693,7 +695,7 @@ def make_figure(args, constructor, trace_patch={}, layout_patch={}):
693695
constructor = (
694696
go.Scattergl if constructor == go.Scatter else go.Scatterpolargl
695697
)
696-
trace = trace_spec.constructor(name=trace_name or " ")
698+
trace = trace_spec.constructor(name=trace_name)
697699
if trace_spec.constructor != go.Parcats:
698700
trace.update(
699701
legendgroup=trace_name,

0 commit comments

Comments
 (0)