Re: [R] scatter plot using ggplot

From: Megh Dal <megh700004_at_yahoo.com>
Date: Tue, 22 Jul 2008 19:30:47 -0700 (PDT)


Thanks for this mail. However I am getting following error on that :

Error in inherits(formula, "formula") : could not find function "aes"

And regarding my 3rd query I actually wanted to get "bigger circles" as points, not intended to increase plot size.

Regards,

> From: hadley wickham <h.wickham_at_gmail.com>
> Subject: Re: [R] scatter plot using ggplot
> To: megh700004@yahoo.com
> Cc: r-help_at_stat.math.ethz.ch
> Date: Tuesday, July 22, 2008, 10:00 PM
> On Tue, Jul 22, 2008 at 3:42 AM, Megh Dal
> <megh700004_at_yahoo.com> wrote:
> > I used ggplot to create a scatter plot :
> >
> > library(ggplot)
> > library(mnormt)
> > Sigma = matrix(c(1, 0.6, 0.6, 1), 2, 2)
> > x = rmnorm(20, c(0,0), Sigma)
> > xx = x[order(x[,1]),]
> > y = xx[,1]
> > z = xx[,2]
> > qplot(z, y, type="point", main="x-y
> plot", xlab="x", col="blue")
> >
> > However I want following:
> >
> > 1. Plot color must be Blue (where it is displaying as
> red)
> > 2. There should not be any color platted
>
> You can't currently do this with qplot (but will be
> able to in the
> next version). Use ggplot() instead:
>
> ggplot(data.frame(y,z), aes(y, z)) +
> geom_point(colour = "blue") +
> scale_x_continuous("x") +
> opts(title = "x-y plot")
>
> > 3. Plot size must be larger than what it is displacing
>
> Make the window bigger?
>
> Hadley
>
> --
> http://had.co.nz/



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. Received on Wed 23 Jul 2008 - 02:34:03 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 Jul 2008 - 10:32:12 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive