Displaying 1 result from an estimated 1 matches for "984ea3".
Did you mean:
984763
2009 Jun 26
1
gradient fill of a grid.polygon
...ncol=2) %*% matR
editGrob(g, x=unit(new.xy[,1],"npc") + gravity.x,
y=unit(new.xy[,2],"npc") + gravity.y)
}
gradient.polygon <- function(g, n=100,
cols=colorRampPalette(c("#E41A1C", "#377EB8", "#4DAF4A", "#984EA3"))(n),
alpha=0.5,
stripe=FALSE, angle=0){
vp = viewport(angle = angle)
g = rotate.polygon(g, - angle)
gx <- grobWidth(g)
gy <- grobHeight(g)
dx <- unit(convertX(gx, "npc", valueOnly = TRUE)/(n-1), "npc") # width of
the stripes
startx <- min(g$x)
starty &l...