[R] ggplot2: positioning legend on top of plot

hadley wickham h.wickham at gmail.com
Mon Nov 24 19:58:01 CET 2008


Hi Paul,

That's a bug - I'll look into it.

Regards,

Hadley

On Mon, Nov 24, 2008 at 10:46 AM, Paul Emberson <email at calidasoft.co.uk> wrote:
> Hi,
>
> With ggplot2 v0.8, how do I position a legend on top of the plot. Things
> like
>
> p + opts(legend.position="top")
>
> work ok.  But
>
> p + opts(legend.position=c(0.5,0.5))
>
> gives
>
> Error in as.character(x) :
>  cannot coerce type 'closure' to vector of type 'character'
>
> so obviously I should be giving a string instead but I can't figure out what
> it should be.
>
> Thanks,
>
> Paul
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



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



More information about the R-help mailing list