Hi,
Thank you Sarah for your help. Sorry for the no reproductible example.
Momadou
 

________________________________
 De : Sarah Goslee <sarah.goslee@gmail.com>

Cc : "R-sig-ecology@r-project.org" <R-sig-ecology@r-project.org> 
Envoyé le : Lundi 12 Décembre 2011 20h52
Objet : Re: Re : [R-sig-eco] Problem with Polygon

Still no reproducible example, but it's likely that you need to reorder
the points: they're drawn in the order you specify. Compare:

plot(1:10, 1:10, type="n")
polygon(c(1, 2, 3, 6), c(1, 1, 8, 10))
polygon(c(1, 2, 6, 3)+4, c(1, 1, 10, 8))

You might instead want the convex hull, and code something like:
> pointdata <- data.frame(x=c(1, 2, 3, 6), y=c(1, 1, 8, 10))
> polygon(pointdata[chull(pointdata), ], col="blue")

But please, a small reproducible example next time.

Sarah


> Thank you Sarah,
> To answer your request, I attached my output. It seem me bad because, when I
> drew the only variable (MeanArea)  the shape of the figure was generally
> concave.I suppose that my output with polygon function would take a close
> shape.
> Thank to you
> Momadou
>
> De : Sarah Goslee <sarah.goslee@gmail.com>

> Cc : "R-sig-ecology@r-project.org" <R-sig-ecology@r-project.org>
> Envoyé le : Lundi 12 Décembre 2011 19h39
> Objet : Re: [R-sig-eco] Problem with Polygon
>
> It's very hard to help you without:
> a small reproducible example;
> an idea of what you are getting vs what you expect - "does not seem
> good" is not particularly informative.
>
> Otherwise we really can't tell what's wrong.
>
> Sarah
>

>> Hi,
>> I have a
>> matrix with 3 columns (Date, MeanArea and SdArea). I want to draw a figure
>> showing
>> the variable MeanArea in terms ofthe
>> Date.
>> But instead to use the variable SdAreaas
>> bar error, I want to use “polygon error”. I use this code but the output
>> does
>> not seem good.
>>>Poly<read.table("C:\\Users\\Documents\\AreaMonthly.csv",sep=";",dec=",",header=TRUE)
>>>Poly
>>>y <-MeanArea
>>>x <-SdArea
>>>z <-Date
>>>matplot(x,cbind(y,z),type="n")
>>>polygon(c(x,rev(x)),c(y,rev(z)),col="grey50")
>> Thank
>> you in advance
>
>
> --
> Sarah Goslee
> http://www.functionaldiversity.org
>
>



-- 
Sarah Goslee
http://www.stringpage.com
http://www.sarahgoslee.com
http://www.functionaldiversity.org
	[[alternative HTML version deleted]]

