I was trying to create a violin plot using a continuous variable factored in x. I currently have the x values of 0,3,5,8. When I plot them as a violin they show up equally spaced from each other. Is there a way to force the locations of the violins to be at essentially 0,3,5,8?
I included some sample data and the line I was essentially trying to run.
condition movedur
[1,] 5 0.935
[2,] 0 1.635
[3,] 3 0.905
[4,] 8 0.875
[5,] 3 1.060
[6,] 8 1.110
[7,] 3 1.830
[8,] 5 1.060
[9,] 5 1.385
[10,] 5 1.560
[11,] 0 1.335
[12,] 3 0.880
[13,] 0 1.030
[14,] 8 1.300
[15,] 3 1.230
[16,] 3 1.210
[17,] 5 1.710
[18,] 3 1.000
[19,] 0 1.365
[20,] 0 1.000
ggplot(a, aes(x = condition, y = movedur, fill = condition)) +
geom_violin()
When I run the full code I get the image below. But the x axis is equally spaced instead of being spaced by the values.