Closed churli closed 2 years ago
For context: I needed to have horizontal violin e boxplots and found it easy to tweak the StatsPlots library to get them, now I'm sharing this back with you. Cheers!
That looks good already, it would be good to use the existing attribute orientation
though. Maybe you can compare to the recipe for boxplots ( that got this in https://github.com/JuliaPlots/StatsPlots.jl/commit/be7f9c03110242707915aaaae8e1e316b179a3d5).
Thanks a lot for the suggestion, my bad that I didn't check how it was implemented for boxplots. Now it works through the orientation attribute for violins and dotplots as well.
It doesn't account for the tick labels though. Here is a MWE
using StatsPlots
import RDatasets
singers = RDatasets.dataset("lattice", "singer")
@df singers violin(:VoicePart, :Height, line = 0, fill = (0.2, :blue), orientation = :horizontal)
The horizontal::Bool kwarg has been added to the violin and dotplot recipes and this allows generating horizontal versions of these plots.