Unable to plot split violin plots with layout attributes violingap, violingroupgap, and violinmode


I recently discovered plotly for R and have been quite impressed with the plots that it can produce. Unfortunately, when I was attempting to plot split violin plots (see Violin plots in R), I ran into a warning:
Warning message:
‘layout’ objects don’t have these attributes: ‘violingap’, ‘violingroupgap’, ‘violinmode’
However, when I reviewed the layout documentation (see Layout in R), violingap, violingroupgap, and violinmode were indeed all attributes of the layout.

Therefore, I am quite confused. I am using R 4.0.3 and plotly 4.10.0.

REPREX would be the code at Violin plots in R for “Split Violin Plot”

Is anyone else experiencing this issue?

I have managed a workaround by making each trace a half of their original violin plot and then using subplot() to merge them with a margin = 0; however, it would be much easier if I could figure out why the warning is showing up and plot the split violin plot as intended.


Frustrated Plotly User

As it turns out, I was able to reproduce the “Split Violin Plot” code by updating plotly to version However, I have a sneaking suspicion that updating was not necessary.

After reproducing the code, I noticed that ‘violingap’, ‘violingroupgap’, and ‘violinmode’ were no longer attributes of layout and were actually not necessary for producing split violin plots. However, for the positive and negative halves of the violin plot to be directly adjacent, the grouping variable on the x axis must have the same value for each of the halves.

I hope this helps if someone else runs into this issue.


No longer frustrated plotly user