You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use a fixed alpha aesthetic to manually highlight points in a plot. It fails when color is mapped to a factor.
library(ggplot2)
data(mtcars)
# fails (but should work)
ggplot(mtcars, aes(x=disp, y=hp, color=as.factor(cyl)))+geom_point(alpha=seq(0,1,length.out=32))
# Error: Aesthetics must be either length 1 or the same as the data (3): alpha
# fails (and should fail)
ggplot(mtcars, aes(x=disp, y=hp, color=as.factor(cyl)))+geom_point(alpha=seq(0,1,length.out=3))
# Error: Aesthetics must be either length 1 or the same as the data (32): alpha
# succeeds
ggplot(mtcars, aes(x=disp, y=hp, color=cyl))+geom_point(alpha=seq(0,1,length.out=32))
Tested on version 2.2.0
The text was updated successfully, but these errors were encountered:
I'm trying to use a fixed alpha aesthetic to manually highlight points in a plot. It fails when color is mapped to a factor.
Tested on version 2.2.0
The text was updated successfully, but these errors were encountered: