Hi Jason, You can do:
qplot(mpg, wt, data = mtcars, colour = factor(cyl)) + opts(legend.position = c(0.5, 0.5)) Hadley On Thu, Jan 8, 2009 at 3:04 PM, Jason Rupert <jasonkrup...@yahoo.com> wrote: > Thank you again for your response. > > This worked great. > > Quick question about the legend for qplot. Instead of being outside the > plot, is it possible to move the location of the legend to the upper left or > right corner of the plot? Could you possibly provide an example. > > Thank you again for your feedback and insights. > > --- On Wed, 1/7/09, hadley wickham <h.wick...@gmail.com> wrote: > > From: hadley wickham <h.wick...@gmail.com> > Subject: Re: Fw: Re: [R] R Stacked Histogram > To: jasonkrup...@yahoo.com, "R-help" <R-help@r-project.org> > Date: Wednesday, January 7, 2009, 12:17 PM > > Hi Jason, > >> Well, one last questions about stack plot (please forgive the lame example >> below). I thought the below allow me to resize the the "title" > of the >> stacked histogram, but no luck. Any suggestions as to the modificaiton >> necessary to get it to work? Right now the title is obscured by the plot >> and my boss will be none too happy. Thanks again. > > Yes, that's a really stupid bug that I accidentally introduced in the > latest version. You can fix it with: > > qplot(mpg, wt, data = mtcars, main = "My title") + opts(plot.title = > theme_text(vjust = 0, size = 16)) > > or by adding a new line to the end of the title: > > qplot(mpg, wt, data = mtcars, main = "My title\n") > > Regards, > > Hadley > -- > http://had.co.nz/ > > -- http://had.co.nz/ ______________________________________________ R-help@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.