Logarithmic x-axis of violin plots

Hello everyone,

I’d like to plot a violin plot on a log10 x-axis, e.g.:

using DataFrames, DataFramesMeta, CairoMakie
df = DataFrame(
    x = repeat(10.0 .^ (-1:3), inner=10),
    y = rand(50)

fig = Figure()
ax = Axis(fig[1,1], xscale = log10)
violin!(ax, df.x, df.y)

This fails because the leftmost violin somehow protrudes into negative x-values before the axis transformation, I guess. And, the width of the violins seem to be constant as well and are also not transformed as can be seen by using side=:right.
Any solution for this?
Would be nice if this would work out-of-the-box.

It’s probably better quality if you don’t transform the violin but log transform the data and then violin that. The problem comes from the violin tails where the kernel extends further than the last data point into the negative values, although there is an attribute which can cut off these ends.

Thanks @jules.

The violin tails extend in y direction and I want to log-scale the x-axis. So it shouldn’t be the tails.

Oh I see, I have never seen a violin plot with the density part on a log axis. You could also try with density and orientation vertical?