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 remove the title ('Type') from the legend?

Thanks!
['https://Stackoverflow.com/questions/6022898', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/745027/']
I found that the best option is to use `+ theme(legend.title = element_blank())` as user "gkcn" noted.

For me (on 03/26/15) using the previously suggested `labs(fill="")` and `scale_fill_discrete("")` remove one title, only to add in another legend, which is not useful.
@pascal 's solution in a [comment](https://stackoverflow.com/questions/6022898/how-can-i-remove-the-legend-title-in-ggplot2#comment41208703_6023078) to set the `name` argument of a scale function, such as `scale_fill_discrete`, to `NULL`, is the best option for me. It allows removing the title together with the blank space that would remain if you used `""`, while at the same time allowing the user to selectively remove titles, which is not possible with the `theme(legend.title = element_blank())` approach.

Since it is buried in a comment, I am posting it as an answer to potentially increase its visibility, with kudos to @pascal.

TL;DR (for the copy-pasters): 

`scale_fill_discrete(name = NULL)`