[R] grid.polygon() + color gradient

2009-06-24 Thread Kexin Ji
Hi, I wonder whether there is a way to generate a polygon (a triangle in my case) with color gradient using grid.polygon() in package grid? I tried something like library(grid) grid.polygon(x=c(0, 0.5, 1), y=c(0.5, 1, 0.5), gp=gpar(col=NA, fill=colorRampPalette(c("green", "lightgray"),

[R] subplot()

2009-06-24 Thread Kexin Ji
Hi, I'm trying to get a color-gradient triangle out of a large plot. Wonder can subplot() generate a triangle? So far, I'm only getting rectangles. Great appreciation for any reply!! Kexin __ R-help@r-project.org mailing list https://stat.ethz.ch/mail

[R] parallel rotated strips with color gradient

2009-06-24 Thread Kexin Ji
Hi, I want to produce two parallel rotated strips with color gradient. So far, the sample strip is something produced by this: pushViewport(viewport(x = unit(0.638, "npc"), y =unit(0.386, "npc"), width=.62, height=0.006, angle=137.2)) grid.rect(y=100:1/100, just="top", gp=gpar(col=NA