julia> d = Normal()
julia> a = rand(d,10,1000)
julia> violin(collect(eachrow(a)),legend = false)
If I have a vector of 10 x-axis points, say x_pts = 1:10:100, then the command violin(map(x-> "x = $x", x_pts),collect(eachrow(a)),legend = false) gives the following figure:
The examples using a data frame (with the @df macro) also work with regular code if you pass vectors of values instead of symbols corresponding to the DataFrame columns.
If you do not have a DataFrame, but just some vectors, you should skip the @df macro altogether.
For example, let’s say your data is
x = rand(["a", "b", "c"], 100)
y = rand(100)
The DataFrame case (let’s say df = DataFrame(col1 = x, col2 = y)) would be handled as
@df df violin(:col1, :col2)
What the macro does, under the hood, is to replace those symbols with the respective columns (df.col1, df.col2). This is not necessary if you have easy access to the vectors, and just