JuliaPlots / StatsPlots.jl

Statistical plotting recipes for Plots.jl
Other
437 stars 88 forks source link

Support drawing boxplots horizontally #468

Closed tpgillam closed 2 years ago

tpgillam commented 2 years ago

Addresses https://github.com/JuliaPlots/StatsPlots.jl/issues/251

Inspired by the way that the orientation attribute is handled in the bar recipe inside Plots.jl

tpgillam commented 2 years ago
boxplot([1, 2, 3], [rand(30); rand(20); rand(10)])
image
boxplot([1, 2, 3], [rand(30); rand(20); rand(10)]; orientation=:horizontal)
image
mkborregaard commented 2 years ago

Looks nice - does this play well with vertical series too?

tpgillam commented 2 years ago

Looks nice - does this play well with vertical series too?

Thanks! Could you give a small example of what you mean by a vertical series please?

It works correctly with a call to vline! after (or first a call to vline, and then a call to boxplot!(...; orientation=:horizontal), if that is what you meant.

tpgillam commented 2 years ago

Just wondering if there's anything else I can do on this? Thanks!

mkborregaard commented 2 years ago

Thanks!