library (ellipse) shape1 = c (1, 0, 0,1) dim(shape1) = c(2,2) ellipse (center = c(0,0), shape = shape1, radius = 1) ============================Error in plot.xy(xy.coords(x, y), type = type, col = col, lty = lty, ...) : plot.new has not been called yet It is really frustrating. Also what do the shape matrix, radius correspond to an ellipse function (x-x0)^2/a + (y-y0)^2/b = 1 ? Please advise! Many thanks, Sun [[alternative HTML version deleted]]
On Wed, 2004-10-27 at 11:34, Sun wrote:> library (ellipse) > > shape1 = c (1, 0, 0,1) > dim(shape1) = c(2,2) > ellipse (center = c(0,0), shape = shape1, radius = 1) > > ============================> Error in plot.xy(xy.coords(x, y), type = type, col = col, lty = lty, ...) : > plot.new has not been called yet > > > It is really frustrating. Also what do the shape matrix, radius correspond to an ellipse function > > (x-x0)^2/a + (y-y0)^2/b = 1 > > ? Please advise!Sun, did you read the ?ellipse help page? I just read, but I didn't find arguments 'center', 'shape' or 'radius' there. It could be useful to use argument specified in the help page. Section 'Details' of ?ellipse explains the parametrization. cheers, jari oksanen -- Jari Oksanen <jarioksa at sun3.oulu.fi>
Thanks a lot. I added that line. library(ellipse) plot(-2:2, type='n') shape1 = c (1, 0, 0,1) dim(shape1) = c(2,2) center1 = c(0,0) radius1 = 1 ellipse (center1, shape1, radius1) But now it said: Error in ellipse(center, shape, radius) : dim<- : dims [product 4] do not match the length of object [200] What is wrong? I don't understand the shape and radius's meaning so I have no idea of what object's lenght. Many thanks! Sun ----- Original Message ----- From: "Patrick Burns" <pburns at pburns.seanet.com> To: "Sun" <sun at cae.wisc.edu> Sent: Wednesday, October 27, 2004 3:51 AM Subject: Re: [R] ploting an ellipse keeps giving errors> The error message is telling you that it expects a plot to already be > there. You can do something like: > > plot(-2:2, type='n') > > Patrick Burns > > Burns Statistics > patrick at burns-stat.com > +44 (0)20 8525 0696 > http://www.burns-stat.com > (home of S Poetry and "A Guide for the Unwilling S User") > > Sun wrote: > > >library (ellipse) > > > >shape1 = c (1, 0, 0,1) > >dim(shape1) = c(2,2) > >ellipse (center = c(0,0), shape = shape1, radius = 1) > > > >============================> >Error in plot.xy(xy.coords(x, y), type = type, col = col, lty = lty, ...):> > plot.new has not been called yet > > > > > >It is really frustrating. Also what do the shape matrix, radiuscorrespond to an ellipse function> > > >(x-x0)^2/a + (y-y0)^2/b = 1 > > > >? Please advise! > > > >Many thanks, > > > >Sun > > [[alternative HTML version deleted]] > > > >______________________________________________ > >R-help at stat.math.ethz.ch mailing list > >https://stat.ethz.ch/mailman/listinfo/r-help > >PLEASE do read the posting guide!http://www.R-project.org/posting-guide.html> > > > > > > > > > >
Hi Did you read what ellipse does and how it shall be used? And what about your system, R and ellipse version?>From your example i got> ellipse (center = c(0,0), shape = shape1, radius = 1)Error in ellipse.default(center = c(0, 0), shape = shape1, radius = 1) : Argument "x" is missing, with no default Ellipse is not for drawing arbitrary ellipses but has different usage. See its help page and an example. Cheers Petr On 27 Oct 2004 at 3:34, Sun wrote:> > library (ellipse) > > shape1 = c (1, 0, 0,1) > dim(shape1) = c(2,2) > ellipse (center = c(0,0), shape = shape1, radius = 1) > > ============================> Error in plot.xy(xy.coords(x, y), type = type, col = col, lty = lty, > ...) : > plot.new has not been called yet > > > It is really frustrating. Also what do the shape matrix, radius > correspond to an ellipse function > > (x-x0)^2/a + (y-y0)^2/b = 1 > > ? Please advise! > > Many thanks, > > Sun > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.htmlPetr Pikal petr.pikal at precheza.cz