Overlay violin plot fails in Julia

Using Julia. I’m trying to plot two distributions (positive side of violin, horizontal, to get a density plot), with a legend. Looking around at several examples I saw two ways to do it:

  1. violinmode = “overlay”
  2. Give an empty name for the traces and use an explicit legendgroup for them.

Method 1 doesn’t seem to work at all, contrary to the examples I’ve seen. Am I doing something wrong?

Method 2 almost works - it works “well enough” when generating HTML (the name appears as the group title - that is, above the color patch, instead of to its right, but at least it is there). But when generating SVG, the legendgrouptitle is not shown - is this a bug in the SVG generation?

Is there a 3rd method which would work better?

(As a secondary question, when showing the graphs one above the other, w/o overlay, why is there such a huge wasted space between them? Is there some way to reduce it?)

Here’s the code:

using PlotlyJS

valuess = [ [
    0.75, 5.25, 5.5, 6, 6.2, 6.6, 6.80, 7.0, 7.2, 7.5, 7.5, 7.75, 8.15, 8.15, 8.65, 8.93, 9.2, 9.5, 10, 10.25, 11.5, 12,
    16, 20.90, 22.3, 23.25,
], [
    79, 54, 74, 62, 85, 55, 88, 85, 51, 85, 54, 84, 78, 47, 83, 52, 62, 84, 52, 79, 51, 47, 78, 69, 74, 83, 55, 76, 78,
    79, 73, 77, 66, 80, 74, 52, 48, 80, 59, 90, 80, 58, 84, 58, 73, 83, 64, 53, 82, 59, 75, 90, 54, 80, 54, 83, 71, 64,
    77, 81, 59, 84, 48, 82, 60, 92, 78, 78, 65, 73, 82, 56, 79, 71, 62, 76, 60, 78, 76, 83, 75, 82, 70, 65, 73, 88, 76,
    80, 48, 86, 60, 90, 50, 78, 63, 72, 84, 75, 51, 82, 62, 88, 49, 83, 81, 47, 84, 52, 86, 81, 75, 59, 89, 79, 59, 81,
    50, 85, 59, 87, 53, 69, 77, 56, 88, 81, 45, 82, 55, 90, 45, 83, 56, 89, 46, 82, 51, 86, 53, 79, 81, 60, 82, 77, 76,
    59, 80, 49, 96, 53, 77, 77, 65, 81, 71, 70, 81, 93, 53, 89, 45, 86, 58, 78, 66, 76, 63, 88, 52, 93, 49, 57, 77, 68,
    81, 81, 73, 50, 85, 74, 55, 77, 83, 83, 51, 78, 84, 46, 83, 55, 81, 57, 76, 84, 77, 81, 87, 77, 51, 78, 60, 82, 91,
    53, 78, 46, 77, 84, 49, 83, 71, 80, 49, 75, 64, 76, 53, 94, 55, 76, 50, 82, 54, 75, 78, 79, 78, 78, 70, 79, 70, 54,
    86, 50, 90, 54, 54, 77, 79, 64, 75, 47, 86, 63, 85, 82, 57, 82, 67, 74, 54, 83, 73, 73, 88, 80, 71, 83, 56, 79, 78,
    84, 58, 83, 43, 60, 75, 81, 46, 90, 46, 74, 150,
] ./ 10.0 ]

names = ("Foo", "Bar")

# Overlay

traces = [
    violin(x = values, side = "positive", name = name, mode = "overlay")
    for (values, name)
    in zip(valuess, names)
]

layout = Layout(; template = "simple_white", violinmode = "overlay")

figure = plot(traces, layout)

savefig(figure, "bug.overlay.html")
savefig(figure, "bug.overlay.svg")

# Empty name

traces = [
    violin(x = values, side = "positive", name = "", legendgrouptitle_text = name, legendgroup = name)
    for (values, name)
    in zip(valuess, names)
]

layout = Layout(; template = "simple_white")

figure = plot(traces, layout)

savefig(figure, "bug.empty_name.html")
savefig(figure, "bug.empty_name.svg")

And the results are: