[R] Polygon Graph in lattice/ lattice extra
Felix Andrews
felix at nfrac.org
Sat Aug 14 03:43:28 CEST 2010
OK, I've added a 'horizontal' argument to panel.xyarea(), which is
consistent with the meaning in panel.xyplot(). It is available from
R-forge via SVN now, or as a built package within a day or 2 probably.
Questions like this are best sent to package maintainers directly, I think.
Regards
# Felix
On 13 August 2010 22:59, Sebastian <wurster.sebastian at googlemail.com> wrote:
>
> Hi, I'd like to draw a polygon graph. I used the package lattice extra which
> includes a function for that (see:
> http://latticeextra.r-forge.r-project.org/#panel.xyarea&theme=default). But
> i don't want the polygon ending with its filled border at the x-axis (like
> in my code). Instead it should be rotated about 90 degrees and end with its
> filled border at the y-axis.
> I'm pleased about any suggestions or ideas. Thanks, Sebastian
> Here's the code:
>
> library(latticeExtra)
>
> data <-
> as.data.frame(cbind(c(1,2,3,4,1,2,3,4),c(1,1,1,1,2,2,2,2),c(2,3.8,3,3.5,2.2,4,3.2,3.5)))
>
> x <- data$V1
> y <- data$V3
> groups <- data$V2
>
> xyplot(y ~ x, data, groups = groups,
> type='l',
> par.settings = simpleTheme(col = c("grey",
> rgb(166,27,30,maxColorValue = 255)), lwd = c(5,2)),
> superpose = TRUE,
> panel = panel.superpose,
> panel.groups = function(..., group.number) {
> if (group.number == 1)
> panel.xyarea(...) else panel.xyplot(...)
> panel.grid(h=FALSE, v=-1, col.line="grey")
> },
> auto.key=list(columns=2, space="bottom", cex=0.8, size=1.3, adj=1,
> between=0.2, between.colums=0.1, points = FALSE,
> rectangles = TRUE))
> --
> View this message in context: http://r.789695.n4.nabble.com/Polygon-Graph-in-lattice-lattice-extra-tp2324156p2324156.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>
--
Felix Andrews / 安福立
http://www.neurofractal.org/felix/
More information about the R-help
mailing list