I would like to add ground truth values to a violin plot. So suppose I knew that for my category "a"
the true value is 2.0
and I have a violin plot, I could use scatter
like so:
violin(repeat(["a", "b", "c"], outer=100), randn(300), leg=false)
scatter!([(0.5, 2.0)])
Now I used an absolute value (0.5) to determine the x-position of the relevant violin plot which works in this toy example. Unfortunately, with my data, the violin plots use a different spacing, so I cannot just use 0.5, 1.5, 2.5 ...
as the x-positions.
How can I determine the correct x-position to add my ground truth value centered in the corresponding violin plot regardless of the shape of the data?
Thanks
Simon