[R] Polygon Graph in lattice/ lattice extra
Sebastian
wurster.sebastian at googlemail.com
Fri Aug 13 14:59:04 CEST 2010
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.
More information about the R-help
mailing list