r - Changing colours on ggplot2 for geom_smooth with non-default aesthetics -
i plotting glmer.nb model on ggplot2 below:
#plot modeled data p <- ggplot(avg.slice, aes(x =slice.depth.db, y=mp.kg)) + geom_bar(stat = "identity", fill = pallete12, width = slice.width.db) + scale_x_reverse() + coord_flip() + geom_errorbar(aes(ymin=mp.kg-ci, ymax=mp.kg+ci)) + geom_smooth(data=site.pred, aes(x=depth, y=pred.site, color = station), stat = "identity") + #adds model predictions xlab ("sediment depth (cm)") + ylab (expression(paste("microplastic concentration (microplastic kg"^"-1"*")")))
i change colours of stations can't figure out how. i've tried:
pallete_station<-colorramppalette(brewer.pal(12, "paired")) pallete13<-pallete_station(13) p + scale_color_manual(pallete13)
but following error:
error in f(...) : argument "values" missing, no default
i think problem due stations being mapped on different aes
default, can't figure out how adjust this.
Comments
Post a Comment