Let’s take the following MWE:
using CairoMakie, Statistics
fig = Figure()
ax = Axis(fig[1,1])
Dloc = randn(1000)
# Full pdf
violin!(ax, fill(1, length(Dloc)), Dloc)
# Pdf plotted so that it is transparent after some value
c = std(Dloc)
violin!(ax, fill(2, length(Dloc)), Dloc; color = "black", datalimits = (-Inf, c))
violin!(ax, fill(2, length(Dloc)), Dloc;
datalimits = (c, Inf), color = :transparent,
strokecolor = "black", strokewidth = 2,
)
fig
I would like to have the right violin, but with the transparent portion being the correct width, instead of being re-normalized from scratch. Is this possible?