Hi,
Thanks a lot for creating ggbrick — geom_brick is a really cool visualization extension! However, I ran into an issue regarding the fill aesthetic.
Problem
When using a factor variable for fill, geom_brick fails with an error like:
Error in scale_fill_discrete():
! Continuous values supplied to discrete scale.
ℹ Example values: 5, 5, 5, 5, and 5
Even though I explicitly convert the column with factor(type), ggbrick still seems to treat it as continuous, or the scale detection does not work properly.
Minimal Reproducible Example
library(ggbrick)
library(ggplot2)
df <- data.frame(
group = rep(c("A", "B"), each = 10),
type = factor(rep(c("X", "Y"), each = 5, times = 2)),
value = sample(1:100, 20)
)
ggplot(df, aes(x = group, y = value, fill = type)) +
geom_brick(color = NA, size = 0.2)
Thanks again for the package and your time!
Best,
Hi,
Thanks a lot for creating ggbrick —
geom_brickis a really cool visualization extension! However, I ran into an issue regarding thefillaesthetic.Problem
When using a factor variable for
fill,geom_brickfails with an error like:Error in scale_fill_discrete():
! Continuous values supplied to discrete scale.
ℹ Example values: 5, 5, 5, 5, and 5
Even though I explicitly convert the column with
factor(type), ggbrick still seems to treat it as continuous, or the scale detection does not work properly.Minimal Reproducible Example