?? Use the appropriate panel function, not panel.xyplot().
If you don't know what this means, you need to read up on lattice/trellis
graphics.

?panel.polygon

-- Bert

On Tue, Oct 4, 2011 at 7:14 AM, Ken Knoblauch <ken.knoblauch@inserm.fr>wrote:

> markm0705 <markm0705 <at> gmail.com> writes:
> > I would like to plot a string of points as a polygon in xyplot.  I'm a
> bit
> > lost as to how to get the points plotting in the correct order.  I would
> > also like some hints on how to render or fill the polygon.
> >
> > Scrpt below and data file attached
> >
> > Thanks
> >
> > Markm
> >
> > library("lattice")
> >
> > # set size of the window
> > windows(height=7, width=10,rescale=c("fixed"))
> >
> > Data_poly<- read.table("111004_Lode_Outlines.csv",header = TRUE,sep =
> ",",)
> >
> > xyplot(z~y,
> >       data=Data_poly,
> >       type="l"
> > ) http://r.789695.n4.nabble.com/file/n3870788/111004_Lode_Outlines.csv
> > 111004_Lode_Outlines.csv
> >
>
> Before you try this with lattice, you might spend some time
> getting your abscissa values in an order that will plot the
> contour in a sequential fashion.  It's not obvious how to
> do this a priori.  Here is a simple-minded attempt after looking
> at your graphic, just using base graphics.  Maybe, it will
> be sufficient for you to tweak it a bit further for what you
> want.
>
> Data_poly<-
> read.table("
> http://r.789695.n4.nabble.com/file/n3870788/111004_Lode_Outlines.csv",
> header = TRUE,sep = ",",)
> par(mfrow = c(1, 2), pty = "s")
> plot(z ~ y, Data_poly, type = "l")
>
> fh <- with(Data_poly, which(z > 240))
> D_poly <- rbind(Data_poly[fh, ], Data_poly[-rev(fh), ])
> D_poly <- rbind(D_poly, Data_poly[1, ])
>
> plot(z ~ y, D_poly, type = "n")
> with(D_poly, polygon(y, z, col = "lightblue"))
>
> --
> Ken Knoblauch
> Inserm U846
> Stem-cell and Brain Research Institute
> Department of Integrative Neurosciences
> 18 avenue du Doyen Lépine
> 69500 Bron
> France
> tel: +33 (0)4 72 91 34 77
> fax: +33 (0)4 72 91 34 61
> portable: +33 (0)6 84 10 64 10
> http://www.sbri.fr/members/kenneth-knoblauch.html
>
> ______________________________________________
> 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.
>



-- 
"Men by nature long to get on to the ultimate truths, and will often be
impatient with elementary studies or fight shy of them. If it were possible
to reach the ultimate truths without the elementary studies usually prefixed
to them, these would not be preparatory studies but superfluous diversions."

-- Maimonides (1135-1204)

Bert Gunter
Genentech Nonclinical Biostatistics
467-7374
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm

	[[alternative HTML version deleted]]

