Positioning in violin plot

One method might be to exploit the fact that scatter! can use a vector of strings for the x-positions. So something like this:

using StatsPlots
gr()
myviolin = violin(repeat(["a", "b", "c"], outer=100), randn(300), leg=false)
scatter!(["a", "b", "c"], [2,1,0], markersize=10) # note the x-argument
savefig(myviolin, "violin_with_markers.png")

violin_with_markers

Does this work for your case?

1 Like