[R] suppress legend in ggplot(data, aes(y=Y, x=X,fill=Z))?

hadley wickham h.wickham at gmail.com
Tue Sep 23 02:53:13 CEST 2008


On Sun, Sep 21, 2008 at 5:25 PM, Tom Bonen <tom.bonen at googlemail.com> wrote:
> hi,
>
> is there any way to suppress the legend in ggplot(data, aes(y=Y,
> x=X,fill=Z)) ? i'd like the values to be displayed in different colors
> as specified by fill= and this works just fine. but i do not want to
> have the legend on the right that is automactially created when fill
> is specified.

Hi Tom,

+ opts(legend.position = "none")

should do the trick.

Hadley

-- 
http://had.co.nz/



More information about the R-help mailing list