Makie.jl
Makie.jl copied to clipboard
Add example of horizontal orientation to violin
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
.
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))?
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.
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.
Actually, there's already https://github.com/MakieOrg/Makie.jl/issues/926
Should we merge this?
Thanks @kescobo!