<head>
  <!-- Plotly.js -->
  <script src="https://cdn.plot.ly/plotly-1.32.0.min.js"></script>
</head>

<body>
<div id="graph"></div>
</body>
var data = [{
  type: 'violin',
  x: 'nums',
  y: [1,3,5,7,9],
  name: 'Odd',
  side: 'negative',
  box: {
    visible: true
  }
}, {
  type: 'violin',
  y: [0,2,4,6,8], 
  x: 'nums',
  name: 'Even',
  side: 'positive',
  box: {
    visible: true
  }
}]

var layout = {
  title: "Split Violin Plot",
  yaxis: {
    zeroline: false
  },
  violingap: 0,
  violingroupgap: 0,
  violinmode: "overlay",
}

Plotly.plot('graph', data, layout);
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.