I have a data structure where each row represents an individual, and each column represents something about that individual.
I want to plot multiple violins in a single violin plot, where each violin represents a column in my data matrix. But I want each column to be split into two groups, one for male and one for female. I need to be able to do it for ~10 columns.
For example, if we consider the following simple data matrix:
v1 v2 v3 v4 Sex
24 32 84 76 1
12 17 23 98 2
.. .. .. .. .
.. .. .. .. .
34 33 56 87 2
14 42 66 92 1
I want to plot v1, ..., v4 each as a violin split into two by sex. Something like illustrated below. How can I achieve this?