Closed cnrrobertson closed 2 months ago
I'll have to dig into this some more, but a temporary fix is to do the following:
ggplot(penguins, aes(x=:species, y=:bill_depth_mm, color=:island, dodge=:island)) +
geom_boxplot()
However this causes the x-axis labels to be shifted out of place.
It seems like Makie is expecting both dodge and color to have the same grouping variable. There is a cryptic note on the Makie boxplot docs
For all indices corresponding to points within the same box,
color
(but notoutliercolor
) must have the same value.
On the TidierPlots side, we may need to automatically add the dodge
aesthetic whenever color is given.
@cnrrobertson, just as general knowledge, some things broke in TidierPlots 0.6.0 because we removed the dependency on AlgebraOfGraphics, so the package now directly translates its functions into Makie output. The fact that this would break some things was known, so @rdboyes has been working to unbreak things and implement some things that were missing due to the AoG dependency.
Appreciate you sharing examples of things that aren't working so we can review and fix.
@adknudson thanks for suggesting the workaround - this is a more specific example of a general problem I've been trying to figure out the best way to address. We need some way to encode the fact that some aes
options have "grouping" attached to them and others don't (see also unexpected behaviour in more complex geom_smooth
plots)
On this example, note that color
does work in geom_boxplot
if the x
and color
aesthetics are the same, e.g.
ggplot(penguins, aes(x=:species, y=:bill_depth_mm, color=:species)) +
geom_boxplot()
I solved the dodge
/stack
ambiguity for geom_bar
"manually" with the handle_position
function, but I don't love the solution - I will add this to the 0.8.0 checklist
In dev:
ggplot(penguins, aes(x=:species, y=:bill_depth_mm, color=:island)) +
geom_boxplot() + lims(x = (.5, 3.5))
ggplot(penguins, aes(x=:bill_depth_mm, y = :species, color=:island)) +
geom_boxplot() + lims(y = (.5, 3.5))
Recently updated
Tidier
which movedTidierPlots
from 0.5.5 to 0.6.6 and includingcolor
inaes
for boxplots is no longer working (not sure if it's more general than that - works withgeom_point()
orgeom_line()
).Simple example for demonstration:
with error: