Hello, I am trying to obtain a violin plot with different series on the right and on the left.
I have tried this code plying from the example in the doc, but I am unable to specify that one series should be on the left and the other one on the right:
singers = dataset("lattice","singer")
singers[:chorus] = "Scala"
singers2 = deepcopy(singers)
singers2[:Height] = singers2[:Height]+5
singers2[:chorus] = "Moscow"
singersTot = vcat(singers,singers2)
myPlot = violin(singersTot,:VoicePart,:Height, group=:chorus, marker=(0.2,:blue,stroke(0)))
![](https://global.discourse-cdn.com/julialang/original/3X/f/0/f027353d7231b03dc3c9535283a2c47755f8113b.png)
ok, it seems it was not possible… I worked on the StatsPlots package and issued a pull request to allow an additional :side
parameter:
using DataFrames, Plots, StatPlots, RDatasets
singers = dataset("lattice","singer")
singers[:chorus] = "Scala"
singers2 = deepcopy(singers)
singers2[:Height] = singers2[:Height]+5
singers2[:chorus] = "Moscow"
singersTot = vcat(singers,singers2)
myPlot = violin(singers,:VoicePart,:Height, side=:right, marker=(0.2,:blue,stroke(0)), label="Scala")
violin!(singers2,:VoicePart,:Height, side=:left, marker=(0.2,:red,stroke(0)), label="Moscow")
![](https://global.discourse-cdn.com/julialang/original/3X/b/3/b39dbcc7639775a1e9a7369eb05c3b4eada8f7f4.png)
4 Likes
Thanks for the nice work!