How can I remove the legend title in ggplot2?
问题 I have a question concerning the legend in ggplot2. Say I have a hypothetical dataset about mean carrot length for two different colours at two farms: carrots<-NULL carrots$Farm<-rep(c("X","Y"),2) carrots$Type<-rep(c("Orange","Purple"),each=2) carrots$MeanLength<-c(10,6,4,2) carrots<-data.frame(carrots) I make a simple bar plot: require(ggplot2) p<-ggplot(carrots,aes(y=MeanLength,x=Farm,fill=Type)) + geom_bar(position="dodge") + opts(legend.position="top") p My question is: is there a way to