Makie.jl icon indicating copy to clipboard operation
Makie.jl copied to clipboard

Add example of horizontal orientation to violin

Open kescobo opened this issue 5 months ago • 4 comments

I always get confused about which arguments are switched (the values passed, here xs and ys) and which arguments stay the same (eg ylable still applies to the vertical axis).

Let me know if this is useful, and I'm happy to add a similar thing to boxplot.

kescobo avatar Feb 02 '24 16:02 kescobo

OK, I went ahead and updated boxplot, and part of barplot as well. There's already an example of direction=:x for the later; separately, is there a reason the language here isn't consistent (eg why not orientation=:horizontal as in violin (or vice versa))?

kescobo avatar Feb 05 '24 18:02 kescobo

is there a reason the language here isn't consistent

Just that these were written independently, at different points in time. If we can come up with a good way to name all of these, I'd be all for it. We could probably go a deprecation route then and only use the new keyword if the old one isn't automatic, we've done that in earlier cases, too.

I was actually wondering if a simple flip = true keyword would suffice. This would mean each recipe has a "canonical" orientation, and flip just uses the other one. Wouldn't work for 3d, but I don't think there's any recipes to which that would apply. In the "canonical" version, ideally the first argument(s) would correspond to the x dimension and the other(s) to y. This could also be a good way to tell AlgebraOfGraphics about the dimension flipping, maybe.

jkrumbiegel avatar Feb 06 '24 19:02 jkrumbiegel

I was actually wondering if a simple flip = true keyword would suffice

flip seems a bit ambiguous to me, but I could be into it. I remember a lot of bikeshedding around that for Plots.jl, and in any case it's probably orthogonal to this PR. I'll open an issue to track it.

kescobo avatar Feb 07 '24 17:02 kescobo

Actually, there's already https://github.com/MakieOrg/Makie.jl/issues/926

kescobo avatar Feb 07 '24 17:02 kescobo

Should we merge this?

ffreyer avatar Feb 20 '24 13:02 ffreyer

Thanks @kescobo!

jkrumbiegel avatar Feb 20 '24 15:02 jkrumbiegel