[R] gradient fill of a grid.polygon

2009-06-27 Thread baptiste auguie
Following up on my previous post. I've managed to have the function return a gList rather than plot everything directly, but I get a rather obscure error message when I try to wrap the grobs in a gTree with a rotated viewport, Error in x$children[[i]] : attempt to select less than one element ho

[R] gradient fill of a grid.polygon

2009-06-26 Thread baptiste auguie
Dear list, Following a recent enquiry, I've been playing with the idea of creating a colour gradient for a polygon, using the Grid package. The idea is to draw a number of stripes of different colours, using the grid.clip function. Below is my current attempt at this, library(grid) rotate.polyg