Reputation: 1061
I would like to change the line thickness for State = "A"
to 2, but scale_size_manual
doesn't seem to work for stat_smooth
type of line-plotting.
Could someone let me know how to change line thickness for this specific condition?
aaa = data.frame(State=rep(c("A","B","C"),100),x= rnorm(300),y=rnorm(300))
ggplot(aaa,aes(x=x, y=y,col=State))+
geom_point() +
stat_smooth(method=glm,se=FALSE,aes(col=State)) +
scale_size_manual(values = c(2,1,1))
Upvotes: 1
Views: 3019
Reputation: 13304
Add size=State
in stat_smooth
, i.e.:
ggplot(aaa,aes(x=x, y=y,col=State))+
geom_point() +
stat_smooth(method=glm,se=FALSE,aes(col=State,size=State)) +
scale_size_manual(values = c(2,1,1))
Upvotes: 1