Breaks and labels in scale_size_binned()

67 views
Skip to first unread message

Grant Humphries

unread,
May 18, 2021, 3:47:36 PM5/18/21
to ggplot2
Hey everyone - I can't seem to find any clear guidance on this.  R Version 4.03, ggplot v 3.3.2.  Trying to get scale_size_binned() labels to work, but keep getting an error

set.seed(10)
t.dat <- data.frame(x=runif(100),y=runif(100),value=runif(100,1,10))ggplot(t.dat,aes(x=x,y=y))+
geom_point(aes(size=value))+
scale_size_binned(breaks=c(1,2,5,10),
labels=c("1","2","5","10"),
limits = c(1,10))
Error: Breaks and labels are different lengths



Clearly the breaks and labels are not of different lengths - so wondering if there's something else I'm missing here
Reply all
Reply to author
Forward
0 new messages