[R] geom_ribbon function in ggplot2 package

John mi@ojpm @ending from gm@il@com
Wed Dec 19 07:05:07 CET 2018


Hi,

   When using the geom_ribbon function in gglot2 package, I got the text
"fill" above the legend "A" and "B". How can I get rid of the text "fill"
above the legend?

   Thanks!

The code is as follows:


df<-data.frame(x=c(1,2), y=c(1,2), z=c(3,5))
> ggplot(df,
aes(1:2))+geom_ribbon(aes(ymin=0,ymax=df[,"y"],fill="A"),alpha=0.5)+geom_ribbon(aes(ymin=0,ymax=df[,"z"],fill="B"),alpha=0.5)

	[[alternative HTML version deleted]]



More information about the R-help mailing list